<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0,
and the EPL 1.0 (https://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
SQL Grammar
</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<!-- [search] { -->
<script type="text/javascript" src="navigation.js"></script>
</head><body onload="highlight()" onscroll="scroll()">

<table class="nav" onmousemove="return mouseMove(event)"><tr class="nav"><td class="nav" valign="top">
<div id = "searchMenu" style="width: 180px; overflow: hidden;">
<div class="menu" style="white-space:nowrap;">
<img src="images/h2-logo-2.png"
    alt="H2 database logo"
    onclick="document.location='main.html'"
    width="136" height="74"/>
&nbsp;&nbsp;<span id = "goTop" onclick="window.scrollTo(0,0)" style="color: #fff; position:fixed; font-size: 20px; cursor: pointer;">&#x25b2;</span>
</div>

<form action="submit" onsubmit="return goFirst();">
<table width="100%" class="search">
    <tr class="search">
        <td class="search" colspan="2">
<!-- translate
<a href="https://translate.google.com/translate?u=https%3A%2F%2Fh2database.com"
    onclick="javascript:startTranslate();return false;">Translate</a>
<div id = "translate" style="display:none"><div id = "google_translate_element"></div></div>
translate -->
        </td>
    </tr>
    <tr class="search">
        <td class="search" colspan="2">
        <b><label for="search">Search:</label></b>
        </td>
    </tr>
    <tr class="search">
        <td class="search" colspan="2">
            <input id = "search" name="search" type="text" size="16" maxlength="100" onkeyup="listWords(this.value, '')" /><br />
            <input type="reset" id = "clear" style="display:none;" value="Clear" onclick="listWords('', '');" />
        </td>
    </tr>
    <tr class="search" style="display:none;" >
        <td class="search" style="width: 1%; vertical-align: middle;">
            <input id = "highlight" type="checkbox" checked="checked" onclick="highlightCurrent(this.checked, search.value)" />
        </td>
        <td class="search" style="width: 99%; padding: 0px; vertical-align: middle;">
            <label for="highlight">Highlight keyword(s)</label>
        </td>
    </tr>
    <tr class="search">
        <td class="search" colspan="2">
            <table id = "result" style="border: 0px;">
                <tr style="display:none"><td></td></tr>
            </table>
        </td>
    </tr>
</table>
</form>
<div class="menu">
<b><a href="main.html">Home</a></b><br />
<a href="download.html">Download</a><br />
<a href="cheatSheet.html">Cheat Sheet</a><br />
<br />
<b>Documentation</b><br />
<a href="quickstart.html">Quickstart</a><br />
<a href="installation.html">Installation</a><br />
<a href="tutorial.html">Tutorial</a><br />
<a href="features.html">Features</a><br />
<a href="performance.html">Performance</a><br />
<a href="advanced.html">Advanced</a><br />
<br />
<b>Reference</b><br />
<a href="commands.html">Commands</a><br />
<a href="functions.html">Functions</a><br />
&#8226;&nbsp;<a href="functions-aggregate.html">Aggregate</a>
&#8226;&nbsp;<a href="functions-window.html">Window</a>
<br /><br />
<a href="datatypes.html">Data Types</a><br />
<a href="grammar.html">SQL Grammar</a><br />
<a href="systemtables.html">System Tables</a><br />
<a href="../javadoc/index.html">Javadoc</a><br />
<a href="../h2.pdf">PDF (1.5 MB)</a><br />
<br />
<b>Support</b><br />
<a href="faq.html">FAQ</a><br />
<a href="sourceError.html">Error Analyzer</a><br />
<a href="https://groups.google.com/group/h2-database">Google Group (English)</a><br />
<a href="https://groups.google.co.jp/group/h2-database-jp">Google Group (Japanese)</a><br />
<a href="https://groups.google.com/group/h2-cn">Google Group (Chinese)</a><br />
<br />
<b>Appendix</b><br />
<a href="history.html">History &amp; Roadmap</a><br />
<a href="license.html">License</a><br />
<a href="build.html">Build</a><br />
<a href="links.html">Links</a><br />
<a href="mvstore.html">MVStore</a><br />
<a href="architecture.html">Architecture</a><br />
<br />

</div>
</div>
</td>

<td class="nav" style="cursor: e-resize;" onmousedown="return mouseDown(event)" onmouseup="return mouseUp(event)">&nbsp;</td>
<td class="nav"><div class="content">

<!-- } -->

<h1>SQL Grammar</h1>
<h2 id="grammar_index">Index</h2>
<h3>Literals</h3>
<!-- syntax-start
<p class="notranslate">

    <a href="#value">Value</a><br />

    <a href="#array">Array</a><br />

    <a href="#boolean">Boolean</a><br />

    <a href="#bytes">Bytes</a><br />

    <a href="#date">Date</a><br />

    <a href="#date_and_time">Date and time</a><br />

    <a href="#decimal">Decimal</a><br />

    <a href="#dollar_quoted_string">Dollar Quoted String</a><br />

    <a href="#hex_number">Hex Number</a><br />

    <a href="#int">Int</a><br />

    <a href="#json">JSON</a><br />

    <a href="#long">Long</a><br />

    <a href="#null">Null</a><br />

    <a href="#number">Number</a><br />

    <a href="#numeric">Numeric</a><br />

    <a href="#string">String</a><br />

    <a href="#time">Time</a><br />

    <a href="#time_with_time_zone">Time with time zone</a><br />

    <a href="#timestamp">Timestamp</a><br />

    <a href="#timestamp_with_time_zone">Timestamp with time zone</a><br />

    <a href="#interval">Interval</a><br />

    <a href="#interval_year">INTERVAL YEAR</a><br />

    <a href="#interval_month">INTERVAL MONTH</a><br />

    <a href="#interval_day">INTERVAL DAY</a><br />

    <a href="#interval_hour">INTERVAL HOUR</a><br />

    <a href="#interval_minute">INTERVAL MINUTE</a><br />

    <a href="#interval_second">INTERVAL SECOND</a><br />

    <a href="#interval_year_to_month">INTERVAL YEAR TO MONTH</a><br />

    <a href="#interval_day_to_hour">INTERVAL DAY TO HOUR</a><br />

    <a href="#interval_day_to_minute">INTERVAL DAY TO MINUTE</a><br />

    <a href="#interval_day_to_second">INTERVAL DAY TO SECOND</a><br />

    <a href="#interval_hour_to_minute">INTERVAL HOUR TO MINUTE</a><br />

    <a href="#interval_hour_to_second">INTERVAL HOUR TO SECOND</a><br />

    <a href="#interval_minute_to_second">INTERVAL MINUTE TO SECOND</a><br />
</p>
syntax-end -->
<!-- railroad-start -->
<table class="notranslate index">
    <tr>
        <td class="index">
            
                <a href="#value" >Value</a><br />
            
                <a href="#array" >Array</a><br />
            
                <a href="#boolean" >Boolean</a><br />
            
                <a href="#bytes" >Bytes</a><br />
            
                <a href="#date" >Date</a><br />
            
                <a href="#date_and_time" >Date and time</a><br />
            
                <a href="#decimal" >Decimal</a><br />
            
                <a href="#dollar_quoted_string" >Dollar Quoted String</a><br />
            
                <a href="#hex_number" >Hex Number</a><br />
            
                <a href="#int" >Int</a><br />
            
                <a href="#json" >JSON</a><br />
            
                <a href="#long" >Long</a><br />
                    </td><td class="index">
            
                <a href="#null" >Null</a><br />
            
                <a href="#number" >Number</a><br />
            
                <a href="#numeric" >Numeric</a><br />
            
                <a href="#string" >String</a><br />
            
                <a href="#time" >Time</a><br />
            
                <a href="#time_with_time_zone" >Time with time zone</a><br />
            
                <a href="#timestamp" >Timestamp</a><br />
            
                <a href="#timestamp_with_time_zone" >Timestamp with time zone</a><br />
            
                <a href="#interval" >Interval</a><br />
            
                <a href="#interval_year" >INTERVAL YEAR</a><br />
            
                <a href="#interval_month" >INTERVAL MONTH</a><br />
            
                <a href="#interval_day" >INTERVAL DAY</a><br />
                    </td><td class="index">
            
                <a href="#interval_hour" >INTERVAL HOUR</a><br />
            
                <a href="#interval_minute" >INTERVAL MINUTE</a><br />
            
                <a href="#interval_second" >INTERVAL SECOND</a><br />
            
                <a href="#interval_year_to_month" >INTERVAL YEAR TO MONTH</a><br />
            
                <a href="#interval_day_to_hour" >INTERVAL DAY TO HOUR</a><br />
            
                <a href="#interval_day_to_minute" >INTERVAL DAY TO MINUTE</a><br />
            
                <a href="#interval_day_to_second" >INTERVAL DAY TO SECOND</a><br />
            
                <a href="#interval_hour_to_minute" >INTERVAL HOUR TO MINUTE</a><br />
            
                <a href="#interval_hour_to_second" >INTERVAL HOUR TO SECOND</a><br />
            
                <a href="#interval_minute_to_second" >INTERVAL MINUTE TO SECOND</a><br />
                    </td>
    </tr>
</table>
<!-- railroad-end -->

<h3>Datetime fields</h3>
<!-- syntax-start
<p class="notranslate">

    <a href="#datetime_field">Datetime field</a><br />

    <a href="#year_field">Year field</a><br />

    <a href="#month_field">Month field</a><br />

    <a href="#day_of_month_field">Day of month field</a><br />

    <a href="#hour_field">Hour field</a><br />

    <a href="#minute_field">Minute field</a><br />

    <a href="#second_field">Second field</a><br />

    <a href="#millisecond_field">Millisecond field</a><br />

    <a href="#microsecond_field">Microsecond field</a><br />

    <a href="#nanosecond_field">Nanosecond field</a><br />

    <a href="#timezone_hour_field">Timezone hour field</a><br />

    <a href="#timezone_minute_field">Timezone minute field</a><br />

    <a href="#timezone_second_field">Timezone second field</a><br />

    <a href="#day_of_week_field">Day of week field</a><br />

    <a href="#iso_week_year_field">ISO week year field</a><br />

    <a href="#iso_day_of_week_field">ISO day of week field</a><br />

    <a href="#week_of_year_field">Week of year field</a><br />

    <a href="#iso_week_of_year_field">ISO week of year field</a><br />

    <a href="#quarter_field">Quarter field</a><br />

    <a href="#day_of_year_field">Day of year field</a><br />

    <a href="#epoch_field">Epoch field</a><br />
</p>
syntax-end -->
<!-- railroad-start -->
<table class="notranslate index">
    <tr>
        <td class="index">
            
                <a href="#datetime_field" >Datetime field</a><br />
            
                <a href="#year_field" >Year field</a><br />
            
                <a href="#month_field" >Month field</a><br />
            
                <a href="#day_of_month_field" >Day of month field</a><br />
            
                <a href="#hour_field" >Hour field</a><br />
            
                <a href="#minute_field" >Minute field</a><br />
            
                <a href="#second_field" >Second field</a><br />
                    </td><td class="index">
            
                <a href="#millisecond_field" >Millisecond field</a><br />
            
                <a href="#microsecond_field" >Microsecond field</a><br />
            
                <a href="#nanosecond_field" >Nanosecond field</a><br />
            
                <a href="#timezone_hour_field" >Timezone hour field</a><br />
            
                <a href="#timezone_minute_field" >Timezone minute field</a><br />
            
                <a href="#timezone_second_field" >Timezone second field</a><br />
            
                <a href="#day_of_week_field" >Day of week field</a><br />
                    </td><td class="index">
            
                <a href="#iso_week_year_field" >ISO week year field</a><br />
            
                <a href="#iso_day_of_week_field" >ISO day of week field</a><br />
            
                <a href="#week_of_year_field" >Week of year field</a><br />
            
                <a href="#iso_week_of_year_field" >ISO week of year field</a><br />
            
                <a href="#quarter_field" >Quarter field</a><br />
            
                <a href="#day_of_year_field" >Day of year field</a><br />
            
                <a href="#epoch_field" >Epoch field</a><br />
                    </td>
    </tr>
</table>
<!-- railroad-end -->

<h3>Other Grammar</h3>
<!-- syntax-start
<p class="notranslate">

    <a href="#alias" >Alias</a><br />

    <a href="#and_condition" >And Condition</a><br />

    <a href="#case" >Case</a><br />

    <a href="#case_when" >Case When</a><br />

    <a href="#cipher" >Cipher</a><br />

    <a href="#column_definition" >Column Definition</a><br />

    <a href="#comments" >Comments</a><br />

    <a href="#compare" >Compare</a><br />

    <a href="#condition" >Condition</a><br />

    <a href="#condition_right_hand_side" >Condition Right Hand Side</a><br />

    <a href="#constraint" >Constraint</a><br />

    <a href="#constraint_name_definition" >Constraint Name Definition</a><br />

    <a href="#csv_options" >Csv Options</a><br />

    <a href="#data_change_delta_table" >Data Change Delta Table</a><br />

    <a href="#data_type" >Data Type</a><br />

    <a href="#digit" >Digit</a><br />

    <a href="#expression" >Expression</a><br />

    <a href="#factor" >Factor</a><br />

    <a href="#grouping_element" >Grouping element</a><br />

    <a href="#hex" >Hex</a><br />

    <a href="#index_column" >Index Column</a><br />

    <a href="#insert_columns_and_source" >Insert columns and source</a><br />

    <a href="#insert_values" >Insert values</a><br />

    <a href="#join_specification" >Join specification</a><br />

    <a href="#merge_when_clause" >Merge when clause</a><br />

    <a href="#merge_when_matched_clause" >Merge when matched clause</a><br />

    <a href="#merge_when_not_matched_clause" >Merge when not matched clause</a><br />

    <a href="#name" >Name</a><br />

    <a href="#operand" >Operand</a><br />

    <a href="#order" >Order</a><br />

    <a href="#query" >Query</a><br />

    <a href="#quoted_name" >Quoted Name</a><br />

    <a href="#referential_constraint" >Referential Constraint</a><br />

    <a href="#referential_action" >Referential Action</a><br />

    <a href="#script_compression_encryption" >Script Compression Encryption</a><br />

    <a href="#row_value_expression" >Row value expression</a><br />

    <a href="#select_expression" >Select Expression</a><br />

    <a href="#sequence_value_expression" >Sequence value expression</a><br />

    <a href="#sequence_options" >Sequence options</a><br />

    <a href="#sequence_option" >Sequence option</a><br />

    <a href="#set_clause_list" >Set clause list</a><br />

    <a href="#summand" >Summand</a><br />

    <a href="#table_expression" >Table Expression</a><br />

    <a href="#within_group_specification" >Within group specification</a><br />

    <a href="#wildcard_expression" >Wildcard expression</a><br />

    <a href="#window_name_or_specification" >Window name or specification</a><br />

    <a href="#window_specification" >Window specification</a><br />

    <a href="#window_frame" >Window frame</a><br />

    <a href="#window_frame_preceding" >Window frame preceding</a><br />

    <a href="#window_frame_bound" >Window frame bound</a><br />

    <a href="#term" >Term</a><br />

    <a href="#time_zone" >Time zone</a><br />

    <a href="#column" >Column</a><br />
</p>
syntax-end -->
<!-- railroad-start -->
<table class="notranslate index">
    <tr>
        <td class="index">
            
                <a href="#alias" >Alias</a><br />
            
                <a href="#and_condition" >And Condition</a><br />
            
                <a href="#case" >Case</a><br />
            
                <a href="#case_when" >Case When</a><br />
            
                <a href="#cipher" >Cipher</a><br />
            
                <a href="#column_definition" >Column Definition</a><br />
            
                <a href="#comments" >Comments</a><br />
            
                <a href="#compare" >Compare</a><br />
            
                <a href="#condition" >Condition</a><br />
            
                <a href="#condition_right_hand_side" >Condition Right Hand Side</a><br />
            
                <a href="#constraint" >Constraint</a><br />
            
                <a href="#constraint_name_definition" >Constraint Name Definition</a><br />
            
                <a href="#csv_options" >Csv Options</a><br />
            
                <a href="#data_change_delta_table" >Data Change Delta Table</a><br />
            
                <a href="#data_type" >Data Type</a><br />
            
                <a href="#digit" >Digit</a><br />
            
                <a href="#expression" >Expression</a><br />
            
                <a href="#factor" >Factor</a><br />
                    </td><td class="index">
            
                <a href="#grouping_element" >Grouping element</a><br />
            
                <a href="#hex" >Hex</a><br />
            
                <a href="#index_column" >Index Column</a><br />
            
                <a href="#insert_columns_and_source" >Insert columns and source</a><br />
            
                <a href="#insert_values" >Insert values</a><br />
            
                <a href="#join_specification" >Join specification</a><br />
            
                <a href="#merge_when_clause" >Merge when clause</a><br />
            
                <a href="#merge_when_matched_clause" >Merge when matched clause</a><br />
            
                <a href="#merge_when_not_matched_clause" >Merge when not matched clause</a><br />
            
                <a href="#name" >Name</a><br />
            
                <a href="#operand" >Operand</a><br />
            
                <a href="#order" >Order</a><br />
            
                <a href="#query" >Query</a><br />
            
                <a href="#quoted_name" >Quoted Name</a><br />
            
                <a href="#referential_constraint" >Referential Constraint</a><br />
            
                <a href="#referential_action" >Referential Action</a><br />
            
                <a href="#script_compression_encryption" >Script Compression Encryption</a><br />
            
                <a href="#row_value_expression" >Row value expression</a><br />
                    </td><td class="index">
            
                <a href="#select_expression" >Select Expression</a><br />
            
                <a href="#sequence_value_expression" >Sequence value expression</a><br />
            
                <a href="#sequence_options" >Sequence options</a><br />
            
                <a href="#sequence_option" >Sequence option</a><br />
            
                <a href="#set_clause_list" >Set clause list</a><br />
            
                <a href="#summand" >Summand</a><br />
            
                <a href="#table_expression" >Table Expression</a><br />
            
                <a href="#within_group_specification" >Within group specification</a><br />
            
                <a href="#wildcard_expression" >Wildcard expression</a><br />
            
                <a href="#window_name_or_specification" >Window name or specification</a><br />
            
                <a href="#window_specification" >Window specification</a><br />
            
                <a href="#window_frame" >Window frame</a><br />
            
                <a href="#window_frame_preceding" >Window frame preceding</a><br />
            
                <a href="#window_frame_bound" >Window frame bound</a><br />
            
                <a href="#term" >Term</a><br />
            
                <a href="#time_zone" >Time zone</a><br />
            
                <a href="#column" >Column</a><br />
                    </td>
    </tr>
</table>
<!-- railroad-end -->

<!-- railroad-start -->
<h2>Details</h2>
<p>Click on the header to switch between railroad diagram and BNF.</p>
<!-- railroad-end -->

<h2>Literals</h2>

<h3 id="value" class="notranslate" onclick="switchBnf(this)">Value</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#string">string</a> | <a href="grammar.html#dollar_quoted_string">dollarQuotedString</a> | <a href="grammar.html#numeric">numeric</a> | <a href="grammar.html#date_and_time">dateAndTime</a> | <a href="grammar.html#boolean">boolean</a> | <a href="grammar.html#bytes">bytes</a>
| <a href="grammar.html#interval">interval</a> | <a href="grammar.html#array">array</a> | <a href="grammar.html#json">json</a> | <a href="grammar.html#null">null</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#string">string</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#dollar_quoted_string">dollarQuotedString</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#numeric">numeric</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#date_and_time">dateAndTime</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#boolean">boolean</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#bytes">bytes</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval">interval</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#array">array</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#json">json</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#null">null</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#string">string</a> | <a href="grammar.html#dollar_quoted_string">dollarQuotedString</a> | <a href="grammar.html#numeric">numeric</a> | <a href="grammar.html#date_and_time">dateAndTime</a> | <a href="grammar.html#boolean">boolean</a> | <a href="grammar.html#bytes">bytes</a>
| <a href="grammar.html#interval">interval</a> | <a href="grammar.html#array">array</a> | <a href="grammar.html#json">json</a> | <a href="grammar.html#null">null</a>
</pre>
syntax-end -->
<p>A literal value of any data type, or null.</p>
<p>Example:</p>
<p class="notranslate">
10</p>

<h3 id="array" class="notranslate" onclick="switchBnf(this)">Array</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ARRAY &#39;[&#39; [ <a href="grammar.html#expression">expression</a> [,...] ] &#39;]&#39;
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ARRAY [</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">]</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ARRAY &#39;[&#39; [ <a href="grammar.html#expression">expression</a> [,...] ] &#39;]&#39;
</pre>
syntax-end -->
<p>An array of values.</p>
<p>Example:</p>
<p class="notranslate">
ARRAY[1, 2]<br />ARRAY[1]<br />ARRAY[]</p>

<h3 id="boolean" class="notranslate" onclick="switchBnf(this)">Boolean</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
TRUE | FALSE | UNKNOWN
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">TRUE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">FALSE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">UNKNOWN</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TRUE | FALSE | UNKNOWN
</pre>
syntax-end -->
<p>A boolean value. <code>UNKNOWN</code> is a <code>NULL</code> value with the boolean data type.</p>
<p>Example:</p>
<p class="notranslate">
TRUE</p>

<h3 id="bytes" class="notranslate" onclick="switchBnf(this)">Bytes</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
X&#39;<a href="grammar.html#hex">hex</a>&#39; [ &#39;<a href="grammar.html#hex">hex</a>&#39; [...] ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">X &#39; <a href="grammar.html#hex">hex</a> &#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">&#39; <a href="grammar.html#hex">hex</a> &#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
X&#39;<a href="grammar.html#hex">hex</a>&#39; [ &#39;<a href="grammar.html#hex">hex</a>&#39; [...] ]
</pre>
syntax-end -->
<p>A binary value. The hex value is not case sensitive and may contain space characters.</p>
<p>Example:</p>
<p class="notranslate">
X&#39;&#39;<br />X&#39;01FF&#39;<br />X&#39;01 bc 2a&#39;<br />X&#39;01&#39; &#39;02&#39;</p>

<h3 id="date" class="notranslate" onclick="switchBnf(this)">Date</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DATE &#39;[-]yyyy-MM-dd&#39;
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DATE &#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">2000-01-01 &#39;</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DATE &#39;[-]yyyy-MM-dd&#39;
</pre>
syntax-end -->
<p>A date literal.</p>
<p>Example:</p>
<p class="notranslate">
DATE &#39;2004-12-31&#39;</p>

<h3 id="date_and_time" class="notranslate" onclick="switchBnf(this)">Date and time</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#date">date</a> | <a href="grammar.html#time">time</a> | <a href="grammar.html#time_with_time_zone">timeWithTimeZone</a> | <a href="grammar.html#timestamp">timestamp</a> | <a href="grammar.html#timestamp_with_time_zone">timestampWithTimeZone</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#date">date</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#time">time</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#time_with_time_zone">timeWithTimeZone</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#timestamp">timestamp</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#timestamp_with_time_zone">timestampWithTimeZone</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#date">date</a> | <a href="grammar.html#time">time</a> | <a href="grammar.html#time_with_time_zone">timeWithTimeZone</a> | <a href="grammar.html#timestamp">timestamp</a> | <a href="grammar.html#timestamp_with_time_zone">timestampWithTimeZone</a>
</pre>
syntax-end -->
<p>A literal value of any date-time data type.</p>
<p>Example:</p>
<p class="notranslate">
TIMESTAMP &#39;1999-01-31 10:00:00&#39;</p>

<h3 id="decimal" class="notranslate" onclick="switchBnf(this)">Decimal</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
[ + | - ] { { <a href="grammar.html#number">number</a> [ . <a href="grammar.html#number">number</a> ] } | { . <a href="grammar.html#number">number</a> } }
[ E [ + | - ] <a href="grammar.html#number">expNumber</a> [...] ] ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#number">number</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. <a href="grammar.html#number">number</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. <a href="grammar.html#number">number</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">E</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#number">expNumber</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ + | - ] { { <a href="grammar.html#number">number</a> [ . <a href="grammar.html#number">number</a> ] } | { . <a href="grammar.html#number">number</a> } }
[ E [ + | - ] <a href="grammar.html#number">expNumber</a> [...] ] ]
</pre>
syntax-end -->
<p>A decimal number with fixed precision and scale. Internally, <code>java.lang.BigDecimal</code> is used. To ensure the floating point representation is used, use <code>CAST</code>(X <code>AS DOUBLE</code>). There are some special decimal values: to represent positive infinity, use <code>POWER(0, -1)</code>; for negative infinity, use <code>(-POWER(0, -1))</code>; for -0.0, use <code>(-CAST(0 AS DOUBLE))</code>; for <code>NaN</code> (not a number), use <code>SQRT(-1)</code>.</p>
<p>Example:</p>
<p class="notranslate">
SELECT -1600.05<br />SELECT CAST(0 AS DOUBLE)<br />SELECT -1.4e-10</p>

<h3 id="dollar_quoted_string" class="notranslate" onclick="switchBnf(this)">Dollar Quoted String</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
$$anything$$
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">$ $ anything $ $</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
$$anything$$
</pre>
syntax-end -->
<p>A string starts and ends with two dollar signs. Two dollar signs are not allowed within the text. A whitespace is required before the first set of dollar signs. No escaping is required within the text.</p>
<p>Example:</p>
<p class="notranslate">
&#36;&#36;John&#39;s car&#36;&#36;</p>

<h3 id="hex_number" class="notranslate" onclick="switchBnf(this)">Hex Number</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
[ + | - ] 0x { <a href="grammar.html#digit">digit</a> | a-f | A-F } [...]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">0x</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#digit">digit</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">a - f</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">A-F</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ + | - ] 0x { <a href="grammar.html#digit">digit</a> | a-f | A-F } [...]
</pre>
syntax-end -->
<p>A number written in hexadecimal notation.</p>
<p>Example:</p>
<p class="notranslate">
0xff</p>

<h3 id="int" class="notranslate" onclick="switchBnf(this)">Int</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
[ + | - ] <a href="grammar.html#number">number</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#number">number</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ + | - ] <a href="grammar.html#number">number</a>
</pre>
syntax-end -->
<p>The maximum integer number is 2147483647, the minimum is -2147483648.</p>
<p>Example:</p>
<p class="notranslate">
10</p>

<h3 id="json" class="notranslate" onclick="switchBnf(this)">JSON</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
JSON { <a href="grammar.html#bytes">bytes</a> | <a href="grammar.html#string">string</a> }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">JSON</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#bytes">bytes</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#string">string</a></code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
JSON { <a href="grammar.html#bytes">bytes</a> | <a href="grammar.html#string">string</a> }
</pre>
syntax-end -->
<p>A binary or character string with a <code>RFC</code> 8259-compliant <code>JSON</code> text and data format. <code>JSON</code> text is parsed into internal representation. Order of object members is preserved as is. Duplicate object member names are allowed.</p>
<p>Example:</p>
<p class="notranslate">
JSON &#39;{&quot;id&quot;:10,&quot;name&quot;:&quot;What&#39;&#39;s this?&quot;}&#39;<br />JSON &#39;[1, &#39; &#39;2]&#39;;<br />JSON X&#39;7472&#39; &#39;7565&#39;</p>

<h3 id="long" class="notranslate" onclick="switchBnf(this)">Long</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
[ + | - ] <a href="grammar.html#number">number</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#number">number</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ + | - ] <a href="grammar.html#number">number</a>
</pre>
syntax-end -->
<p>Long numbers are between -9223372036854775808 and 9223372036854775807.</p>
<p>Example:</p>
<p class="notranslate">
100000</p>

<h3 id="null" class="notranslate" onclick="switchBnf(this)">Null</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
NULL
</pre>
<div name="railroad">
<code class="c">NULL</code>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
NULL
</pre>
syntax-end -->
<p><code>NULL</code> is a value without data type and means &#39;unknown value&#39;.</p>
<p>Example:</p>
<p class="notranslate">
NULL</p>

<h3 id="number" class="notranslate" onclick="switchBnf(this)">Number</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#digit">digit</a> [...]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#digit">digit</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#digit">digit</a> [...]
</pre>
syntax-end -->
<p>The maximum length of the number depends on the data type used.</p>
<p>Example:</p>
<p class="notranslate">
100</p>

<h3 id="numeric" class="notranslate" onclick="switchBnf(this)">Numeric</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#decimal">decimal</a> | <a href="grammar.html#int">int</a> | <a href="grammar.html#long">long</a> | <a href="grammar.html#hex_number">hexNumber</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#decimal">decimal</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#int">int</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#long">long</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#hex_number">hexNumber</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#decimal">decimal</a> | <a href="grammar.html#int">int</a> | <a href="grammar.html#long">long</a> | <a href="grammar.html#hex_number">hexNumber</a>
</pre>
syntax-end -->
<p>The data type of a numeric value is always the lowest possible for the given value. If the number contains a dot this is decimal; otherwise it is int, long, or decimal (depending on the value).</p>
<p>Example:</p>
<p class="notranslate">
SELECT -1600.05<br />SELECT CAST(0 AS DOUBLE)<br />SELECT -1.4e-10</p>

<h3 id="string" class="notranslate" onclick="switchBnf(this)">String</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
&#39;anything&#39; [ &#39;anything&#39; [...] ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">&#39; anything &#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">&#39; anything &#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
&#39;anything&#39; [ &#39;anything&#39; [...] ]
</pre>
syntax-end -->
<p>A string starts and ends with a single quote. Two single quotes can be used to create a single quote inside a string.</p>
<p>Example:</p>
<p class="notranslate">
&#39;John&#39;&#39;s car&#39;<br />&#39;A&#39; &#39;B&#39; &#39;C&#39;</p>

<h3 id="time" class="notranslate" onclick="switchBnf(this)">Time</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
TIME [ WITHOUT TIME ZONE ] &#39;hh:mm:ss[.nnnnnnnnn]&#39;
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">TIME</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">WITHOUT TIME ZONE</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39; 12:00:00</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. 000000000</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TIME [ WITHOUT TIME ZONE ] &#39;hh:mm:ss[.nnnnnnnnn]&#39;
</pre>
syntax-end -->
<p>A time literal. A value is between 0:00:00 and 23:59:59.999999999 and has nanosecond resolution.</p>
<p>Example:</p>
<p class="notranslate">
TIME &#39;23:59:59&#39;</p>

<h3 id="time_with_time_zone" class="notranslate" onclick="switchBnf(this)">Time with time zone</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
TIME WITH TIME ZONE &#39;hh:mm:ss[.nnnnnnnnn]{Z | { - | + } <a href="grammar.html#string">timeZoneOffsetString</a>}&#39;
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">TIME WITH TIME ZONE &#39; 12:00:00</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. 000000000</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">Z</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#string">timeZoneOffsetString</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TIME WITH TIME ZONE &#39;hh:mm:ss[.nnnnnnnnn]{Z | { - | + } <a href="grammar.html#string">timeZoneOffsetString</a>}&#39;
</pre>
syntax-end -->
<p>A time with time zone literal. A value is between 0:00:00 and 23:59:59.999999999 and has nanosecond resolution.</p>
<p>Example:</p>
<p class="notranslate">
TIME WITH TIME ZONE &#39;23:59:59+01&#39;<br />TIME WITH TIME ZONE &#39;10:15:30.334-03:30&#39;<br />TIME WITH TIME ZONE &#39;0:00:00Z&#39;</p>

<h3 id="timestamp" class="notranslate" onclick="switchBnf(this)">Timestamp</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
TIMESTAMP [ WITHOUT TIME ZONE ] &#39;[-]yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]&#39;
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">TIMESTAMP</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">WITHOUT TIME ZONE</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">2000-01-01 12:00:00</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. 000000000</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TIMESTAMP [ WITHOUT TIME ZONE ] &#39;[-]yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]&#39;
</pre>
syntax-end -->
<p>A timestamp literal.</p>
<p>Example:</p>
<p class="notranslate">
TIMESTAMP &#39;2005-12-31 23:59:59&#39;</p>

<h3 id="timestamp_with_time_zone" class="notranslate" onclick="switchBnf(this)">Timestamp with time zone</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
TIMESTAMP WITH TIME ZONE &#39;[-]yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]
[Z | { - | + } <a href="grammar.html#string">timeZoneOffsetString</a> | <a href="grammar.html#string">timeZoneNameString</a> ]&#39;
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">TIMESTAMP WITH TIME ZONE &#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">2000-01-01 12:00:00</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. 000000000</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">Z</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#string">timeZoneOffsetString</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#string">timeZoneNameString</a></code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TIMESTAMP WITH TIME ZONE &#39;[-]yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]
[Z | { - | + } <a href="grammar.html#string">timeZoneOffsetString</a> | <a href="grammar.html#string">timeZoneNameString</a> ]&#39;
</pre>
syntax-end -->
<p>A timestamp with time zone literal. If name of time zone is specified it will be converted to time zone offset.</p>
<p>Example:</p>
<p class="notranslate">
TIMESTAMP WITH TIME ZONE &#39;2005-12-31 23:59:59Z&#39;<br />TIMESTAMP WITH TIME ZONE &#39;2005-12-31 23:59:59-10:00&#39;<br />TIMESTAMP WITH TIME ZONE &#39;2005-12-31 23:59:59.123+05&#39;<br />TIMESTAMP WITH TIME ZONE &#39;2005-12-31 23:59:59.123456789 Europe/London&#39;</p>

<h3 id="interval" class="notranslate" onclick="switchBnf(this)">Interval</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#interval_year">intervalYear</a> | <a href="grammar.html#interval_month">intervalMonth</a> | <a href="grammar.html#interval_day">intervalDay</a> | <a href="grammar.html#interval_hour">intervalHour</a> | <a href="grammar.html#interval_minute">intervalMinute</a>
| <a href="grammar.html#interval_second">intervalSecond</a> | <a href="grammar.html#interval_year_to_month">intervalYearToMonth</a> | <a href="grammar.html#interval_day_to_hour">intervalDayToHour</a>
| <a href="grammar.html#interval_day_to_minute">intervalDayToMinute</a> | <a href="grammar.html#interval_day_to_second">intervalDayToSecond</a> | <a href="grammar.html#interval_hour_to_minute">intervalHourToMinute</a>
| <a href="grammar.html#interval_hour_to_second">intervalHourToSecond</a> | <a href="grammar.html#interval_minute_to_second">intervalMinuteToSecond</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#interval_year">intervalYear</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_month">intervalMonth</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_day">intervalDay</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_hour">intervalHour</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_minute">intervalMinute</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_second">intervalSecond</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_year_to_month">intervalYearToMonth</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_day_to_hour">intervalDayToHour</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_day_to_minute">intervalDayToMinute</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_day_to_second">intervalDayToSecond</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_hour_to_minute">intervalHourToMinute</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_hour_to_second">intervalHourToSecond</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#interval_minute_to_second">intervalMinuteToSecond</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#interval_year">intervalYear</a> | <a href="grammar.html#interval_month">intervalMonth</a> | <a href="grammar.html#interval_day">intervalDay</a> | <a href="grammar.html#interval_hour">intervalHour</a> | <a href="grammar.html#interval_minute">intervalMinute</a>
| <a href="grammar.html#interval_second">intervalSecond</a> | <a href="grammar.html#interval_year_to_month">intervalYearToMonth</a> | <a href="grammar.html#interval_day_to_hour">intervalDayToHour</a>
| <a href="grammar.html#interval_day_to_minute">intervalDayToMinute</a> | <a href="grammar.html#interval_day_to_second">intervalDayToSecond</a> | <a href="grammar.html#interval_hour_to_minute">intervalHourToMinute</a>
| <a href="grammar.html#interval_hour_to_second">intervalHourToSecond</a> | <a href="grammar.html#interval_minute_to_second">intervalMinuteToSecond</a>
</pre>
syntax-end -->
<p>An interval literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;1-2&#39; YEAR TO MONTH</p>

<h3 id="interval_year" class="notranslate" onclick="switchBnf(this)">INTERVAL YEAR</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">yearInt</a>&#39; YEAR
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#int">yearInt</a> &#39; YEAR</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">yearInt</a>&#39; YEAR
</pre>
syntax-end -->
<p>An <code>INTERVAL YEAR</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;10&#39; YEAR</p>

<h3 id="interval_month" class="notranslate" onclick="switchBnf(this)">INTERVAL MONTH</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">monthInt</a>&#39; MONTH
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#int">monthInt</a> &#39; MONTH</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">monthInt</a>&#39; MONTH
</pre>
syntax-end -->
<p>An <code>INTERVAL MONTH</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;10&#39; MONTH</p>

<h3 id="interval_day" class="notranslate" onclick="switchBnf(this)">INTERVAL DAY</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">dayInt</a>&#39; DAY
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#int">dayInt</a> &#39; DAY</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">dayInt</a>&#39; DAY
</pre>
syntax-end -->
<p>An <code>INTERVAL DAY</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;10&#39; DAY</p>

<h3 id="interval_hour" class="notranslate" onclick="switchBnf(this)">INTERVAL HOUR</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">hourInt</a>&#39; HOUR
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#int">hourInt</a> &#39; HOUR</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">hourInt</a>&#39; HOUR
</pre>
syntax-end -->
<p>An <code>INTERVAL HOUR</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;10&#39; HOUR</p>

<h3 id="interval_minute" class="notranslate" onclick="switchBnf(this)">INTERVAL MINUTE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">minuteInt</a>&#39; MINUTE
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#int">minuteInt</a> &#39; MINUTE</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">minuteInt</a>&#39; MINUTE
</pre>
syntax-end -->
<p>An <code>INTERVAL MINUTE</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;10&#39; MINUTE</p>

<h3 id="interval_second" class="notranslate" onclick="switchBnf(this)">INTERVAL SECOND</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">secondInt</a>[.nnnnnnnnn]&#39; SECOND
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#int">secondInt</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. 000000000</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39; SECOND</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">secondInt</a>[.nnnnnnnnn]&#39; SECOND
</pre>
syntax-end -->
<p>An <code>INTERVAL SECOND</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;10.123&#39; SECOND</p>

<h3 id="interval_year_to_month" class="notranslate" onclick="switchBnf(this)">INTERVAL YEAR TO MONTH</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">yearInt</a>-<a href="grammar.html#int">monthInt</a>&#39; YEAR TO MONTH
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#int">yearInt</a> - <a href="grammar.html#int">monthInt</a> &#39; YEAR TO MONTH</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">yearInt</a>-<a href="grammar.html#int">monthInt</a>&#39; YEAR TO MONTH
</pre>
syntax-end -->
<p>An <code>INTERVAL YEAR TO MONTH</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;1-6&#39; YEAR TO MONTH</p>

<h3 id="interval_day_to_hour" class="notranslate" onclick="switchBnf(this)">INTERVAL DAY TO HOUR</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">dayInt</a> <a href="grammar.html#int">hoursInt</a>&#39; DAY TO HOUR
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#int">dayInt</a> <a href="grammar.html#int">hoursInt</a> &#39; DAY TO HOUR</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">dayInt</a> <a href="grammar.html#int">hoursInt</a>&#39; DAY TO HOUR
</pre>
syntax-end -->
<p>An <code>INTERVAL DAY TO HOUR</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;10 11&#39; DAY TO HOUR</p>

<h3 id="interval_day_to_minute" class="notranslate" onclick="switchBnf(this)">INTERVAL DAY TO MINUTE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">dayInt</a> hh:mm&#39; DAY TO MINUTE
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#int">dayInt</a> 12:00:00 &#39; DAY TO MINUTE</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">dayInt</a> hh:mm&#39; DAY TO MINUTE
</pre>
syntax-end -->
<p>An <code>INTERVAL DAY TO MINUTE</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;10 11:12&#39; DAY TO MINUTE</p>

<h3 id="interval_day_to_second" class="notranslate" onclick="switchBnf(this)">INTERVAL DAY TO SECOND</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">dayInt</a> hh:mm:ss[.nnnnnnnnn]&#39; DAY TO SECOND
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#int">dayInt</a> 12:00:00</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. 000000000</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39; DAY TO SECOND</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]<a href="grammar.html#int">dayInt</a> hh:mm:ss[.nnnnnnnnn]&#39; DAY TO SECOND
</pre>
syntax-end -->
<p>An <code>INTERVAL DAY TO SECOND</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;10 11:12:13.123&#39; DAY TO SECOND</p>

<h3 id="interval_hour_to_minute" class="notranslate" onclick="switchBnf(this)">INTERVAL HOUR TO MINUTE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]hh:mm&#39; HOUR TO MINUTE
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">12:00:00 &#39; HOUR TO MINUTE</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]hh:mm&#39; HOUR TO MINUTE
</pre>
syntax-end -->
<p>An <code>INTERVAL HOUR TO MINUTE</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;10:11&#39; HOUR TO MINUTE</p>

<h3 id="interval_hour_to_second" class="notranslate" onclick="switchBnf(this)">INTERVAL HOUR TO SECOND</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]hh:mm:ss[.nnnnnnnnn]&#39; HOUR TO SECOND
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">12:00:00</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. 000000000</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39; HOUR TO SECOND</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]hh:mm:ss[.nnnnnnnnn]&#39; HOUR TO SECOND
</pre>
syntax-end -->
<p>An <code>INTERVAL HOUR TO SECOND</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;10:11:12.123&#39; HOUR TO SECOND</p>

<h3 id="interval_minute_to_second" class="notranslate" onclick="switchBnf(this)">INTERVAL MINUTE TO SECOND</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INTERVAL [-|+] &#39;[-|+]mm:ss[.nnnnnnnnn]&#39; MINUTE TO SECOND
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERVAL</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">12:00:00</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. 000000000</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&#39; MINUTE TO SECOND</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INTERVAL [-|+] &#39;[-|+]mm:ss[.nnnnnnnnn]&#39; MINUTE TO SECOND
</pre>
syntax-end -->
<p>An <code>INTERVAL MINUTE TO SECOND</code> literal.</p>
<p>Example:</p>
<p class="notranslate">
INTERVAL &#39;11:12.123&#39; MINUTE TO SECOND</p>

<h2>Datetime fields</h2>

<h3 id="datetime_field" class="notranslate" onclick="switchBnf(this)">Datetime field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#year_field">yearField</a> | <a href="grammar.html#month_field">monthField</a> | <a href="grammar.html#day_of_month_field">dayOfMonthField</a>
| <a href="grammar.html#hour_field">hourField</a> | <a href="grammar.html#minute_field">minuteField</a> | <a href="grammar.html#second_field">secondField</a>
| <a href="grammar.html#millisecond_field">millisecondField</a> | <a href="grammar.html#microsecond_field">microsecondField</a> | <a href="grammar.html#nanosecond_field">nanosecondField</a>
| <a href="grammar.html#timezone_hour_field">timezoneHourField</a> | <a href="grammar.html#timezone_minute_field">timezoneMinuteField</a> | <a href="grammar.html#timezone_second_field">timezoneSecondField</a>
| <a href="grammar.html#day_of_week_field">dayOfWeekField</a> | <a href="grammar.html#iso_week_year_field">isoWeekYearField</a> | <a href="grammar.html#iso_day_of_week_field">isoDayOfWeekField</a>
| <a href="grammar.html#week_of_year_field">weekOfYearField</a> | <a href="grammar.html#iso_week_of_year_field">isoWeekOfYearField</a>
| <a href="grammar.html#quarter_field">quarterField</a> | <a href="grammar.html#day_of_year_field">dayOfYearField</a> | <a href="grammar.html#epoch_field">epochField</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#year_field">yearField</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#month_field">monthField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#day_of_month_field">dayOfMonthField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#hour_field">hourField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#minute_field">minuteField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#second_field">secondField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#millisecond_field">millisecondField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#microsecond_field">microsecondField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#nanosecond_field">nanosecondField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#timezone_hour_field">timezoneHourField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#timezone_minute_field">timezoneMinuteField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#timezone_second_field">timezoneSecondField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#day_of_week_field">dayOfWeekField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#iso_week_year_field">isoWeekYearField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#iso_day_of_week_field">isoDayOfWeekField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#week_of_year_field">weekOfYearField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#iso_week_of_year_field">isoWeekOfYearField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#quarter_field">quarterField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#day_of_year_field">dayOfYearField</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#epoch_field">epochField</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#year_field">yearField</a> | <a href="grammar.html#month_field">monthField</a> | <a href="grammar.html#day_of_month_field">dayOfMonthField</a>
| <a href="grammar.html#hour_field">hourField</a> | <a href="grammar.html#minute_field">minuteField</a> | <a href="grammar.html#second_field">secondField</a>
| <a href="grammar.html#millisecond_field">millisecondField</a> | <a href="grammar.html#microsecond_field">microsecondField</a> | <a href="grammar.html#nanosecond_field">nanosecondField</a>
| <a href="grammar.html#timezone_hour_field">timezoneHourField</a> | <a href="grammar.html#timezone_minute_field">timezoneMinuteField</a> | <a href="grammar.html#timezone_second_field">timezoneSecondField</a>
| <a href="grammar.html#day_of_week_field">dayOfWeekField</a> | <a href="grammar.html#iso_week_year_field">isoWeekYearField</a> | <a href="grammar.html#iso_day_of_week_field">isoDayOfWeekField</a>
| <a href="grammar.html#week_of_year_field">weekOfYearField</a> | <a href="grammar.html#iso_week_of_year_field">isoWeekOfYearField</a>
| <a href="grammar.html#quarter_field">quarterField</a> | <a href="grammar.html#day_of_year_field">dayOfYearField</a> | <a href="grammar.html#epoch_field">epochField</a>
</pre>
syntax-end -->
<p>Fields for <code>EXTRACT, DATEADD</code>, and <code>DATEDIFF</code> functions.</p>
<p>Example:</p>
<p class="notranslate">
YEAR</p>

<h3 id="year_field" class="notranslate" onclick="switchBnf(this)">Year field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
YEAR | YYYY | YY | SQL_TSI_YEAR
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">YEAR</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">YYYY</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">YY</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SQL_TSI_YEAR</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
YEAR | YYYY | YY | SQL_TSI_YEAR
</pre>
syntax-end -->
<p>Year.</p>
<p>Example:</p>
<p class="notranslate">
YEAR</p>

<h3 id="month_field" class="notranslate" onclick="switchBnf(this)">Month field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
MONTH | MM | M | SQL_TSI_MONTH
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">MONTH</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">MM</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">M</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SQL_TSI_MONTH</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
MONTH | MM | M | SQL_TSI_MONTH
</pre>
syntax-end -->
<p>Month (1-12).</p>
<p>Example:</p>
<p class="notranslate">
MONTH</p>

<h3 id="day_of_month_field" class="notranslate" onclick="switchBnf(this)">Day of month field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DAY | DD | D | SQL_TSI_DAY
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DAY</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">DD</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">D</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SQL_TSI_DAY</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DAY | DD | D | SQL_TSI_DAY
</pre>
syntax-end -->
<p>Day of month (1-31).</p>
<p>Example:</p>
<p class="notranslate">
DAY</p>

<h3 id="hour_field" class="notranslate" onclick="switchBnf(this)">Hour field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
HOUR | HH | SQL_TSI_HOUR
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">HOUR</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">HH</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SQL_TSI_HOUR</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
HOUR | HH | SQL_TSI_HOUR
</pre>
syntax-end -->
<p>Hour (0-23).</p>
<p>Example:</p>
<p class="notranslate">
HOUR</p>

<h3 id="minute_field" class="notranslate" onclick="switchBnf(this)">Minute field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
MINUTE | MI | N | SQL_TSI_MINUTE
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">MINUTE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">MI</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">N</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SQL_TSI_MINUTE</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
MINUTE | MI | N | SQL_TSI_MINUTE
</pre>
syntax-end -->
<p>Minute (0-59).</p>
<p>Example:</p>
<p class="notranslate">
MINUTE</p>

<h3 id="second_field" class="notranslate" onclick="switchBnf(this)">Second field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SECOND | SS | S | SQL_TSI_SECOND
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">SECOND</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">SS</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">S</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SQL_TSI_SECOND</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SECOND | SS | S | SQL_TSI_SECOND
</pre>
syntax-end -->
<p>Second (0-59).</p>
<p>Example:</p>
<p class="notranslate">
SECOND</p>

<h3 id="millisecond_field" class="notranslate" onclick="switchBnf(this)">Millisecond field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
MILLISECOND | MS
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">MILLISECOND</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">MS</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
MILLISECOND | MS
</pre>
syntax-end -->
<p>Millisecond (0-999).</p>
<p>Example:</p>
<p class="notranslate">
MILLISECOND</p>

<h3 id="microsecond_field" class="notranslate" onclick="switchBnf(this)">Microsecond field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
MICROSECOND | MCS
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">MICROSECOND</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">MCS</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
MICROSECOND | MCS
</pre>
syntax-end -->
<p>Microsecond (0-999999).</p>
<p>Example:</p>
<p class="notranslate">
MICROSECOND</p>

<h3 id="nanosecond_field" class="notranslate" onclick="switchBnf(this)">Nanosecond field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
NANOSECOND | NS
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">NANOSECOND</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NS</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
NANOSECOND | NS
</pre>
syntax-end -->
<p>Nanosecond (0-999999999).</p>
<p>Example:</p>
<p class="notranslate">
NANOSECOND</p>

<h3 id="timezone_hour_field" class="notranslate" onclick="switchBnf(this)">Timezone hour field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
TIMEZONE_HOUR
</pre>
<div name="railroad">
<code class="c">TIMEZONE_HOUR</code>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TIMEZONE_HOUR
</pre>
syntax-end -->
<p>Timezone hour (from -18 to +18).</p>
<p>Example:</p>
<p class="notranslate">
TIMEZONE_HOUR</p>

<h3 id="timezone_minute_field" class="notranslate" onclick="switchBnf(this)">Timezone minute field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
TIMEZONE_MINUTE
</pre>
<div name="railroad">
<code class="c">TIMEZONE_MINUTE</code>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TIMEZONE_MINUTE
</pre>
syntax-end -->
<p>Timezone minute (from -59 to +59).</p>
<p>Example:</p>
<p class="notranslate">
TIMEZONE_MINUTE</p>

<h3 id="timezone_second_field" class="notranslate" onclick="switchBnf(this)">Timezone second field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
TIMEZONE_SECOND
</pre>
<div name="railroad">
<code class="c">TIMEZONE_SECOND</code>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TIMEZONE_SECOND
</pre>
syntax-end -->
<p>Timezone second (from -59 to +59). Local mean time (<code>LMT</code>) used in the past may have offsets with seconds. Standard time doesn&#39;t use such offsets.</p>
<p>Example:</p>
<p class="notranslate">
TIMEZONE_SECOND</p>

<h3 id="day_of_week_field" class="notranslate" onclick="switchBnf(this)">Day of week field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DAY_OF_WEEK | DAYOFWEEK | DOW
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DAY_OF_WEEK</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">DAYOFWEEK</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DOW</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DAY_OF_WEEK | DAYOFWEEK | DOW
</pre>
syntax-end -->
<p>Day of week (1-7). Sunday is 1.</p>
<p>Example:</p>
<p class="notranslate">
DAY_OF_WEEK</p>

<h3 id="iso_week_year_field" class="notranslate" onclick="switchBnf(this)">ISO week year field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ISO_YEAR | ISOYEAR
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">ISO_YEAR</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">ISOYEAR</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ISO_YEAR | ISOYEAR
</pre>
syntax-end -->
<p>Returns the <code>ISO</code> week year from a date/time value.</p>
<p>Example:</p>
<p class="notranslate">
ISO_YEAR</p>

<h3 id="iso_day_of_week_field" class="notranslate" onclick="switchBnf(this)">ISO day of week field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ISO_DAY_OF_WEEK | ISODOW
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">ISO_DAY_OF_WEEK</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">ISODOW</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ISO_DAY_OF_WEEK | ISODOW
</pre>
syntax-end -->
<p><code>ISO</code> day of week (1-7). Monday is 1.</p>
<p>Example:</p>
<p class="notranslate">
ISO_DAY_OF_WEEK</p>

<h3 id="week_of_year_field" class="notranslate" onclick="switchBnf(this)">Week of year field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
WEEK | WW | W | SQL_TSI_WEEK
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">WEEK</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">WW</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">W</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SQL_TSI_WEEK</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
WEEK | WW | W | SQL_TSI_WEEK
</pre>
syntax-end -->
<p>Week of year (1-53). <code>EXTRACT</code> function uses local rules to get number of week in year. <code>DATEDIFF</code> function uses Sunday as a first day of week.</p>
<p>Example:</p>
<p class="notranslate">
WEEK</p>

<h3 id="iso_week_of_year_field" class="notranslate" onclick="switchBnf(this)">ISO week of year field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ISO_WEEK
</pre>
<div name="railroad">
<code class="c">ISO_WEEK</code>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ISO_WEEK
</pre>
syntax-end -->
<p><code>ISO</code> week of year (1-53). <code>ISO</code> definition is used when first week of year should have at least four days and week is started with Monday.</p>
<p>Example:</p>
<p class="notranslate">
ISO_WEEK</p>

<h3 id="quarter_field" class="notranslate" onclick="switchBnf(this)">Quarter field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
QUARTER
</pre>
<div name="railroad">
<code class="c">QUARTER</code>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
QUARTER
</pre>
syntax-end -->
<p>Quarter (1-4).</p>
<p>Example:</p>
<p class="notranslate">
QUARTER</p>

<h3 id="day_of_year_field" class="notranslate" onclick="switchBnf(this)">Day of year field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DAYOFYEAR | DAY_OF_YEAR | DOY | DY
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DAYOFYEAR</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">DAY_OF_YEAR</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">DOY</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DY</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DAYOFYEAR | DAY_OF_YEAR | DOY | DY
</pre>
syntax-end -->
<p>Day of year (1-366).</p>
<p>Example:</p>
<p class="notranslate">
DAYOFYEAR</p>

<h3 id="epoch_field" class="notranslate" onclick="switchBnf(this)">Epoch field</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
EPOCH
</pre>
<div name="railroad">
<code class="c">EPOCH</code>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
EPOCH
</pre>
syntax-end -->
<p>For <code>TIMESTAMP</code> values number of seconds since 1970-01-01 00:00:00 in local time zone. For <code>TIMESTAMP WITH TIME ZONE</code> values number of seconds since 1970-01-01 00:00:00 in <code>UTC</code> time zone. For <code>DATE</code> values number of seconds since 1970-01-01. For <code>TIME</code> values number of seconds since midnight.</p>
<p>Example:</p>
<p class="notranslate">
EPOCH</p>

<h2>Other Grammar</h2>

<h3 id="alias" class="notranslate" onclick="switchBnf(this)">Alias</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#name">name</a>
</pre>
<div name="railroad">
<code class="c"><a href="grammar.html#name">name</a></code>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#name">name</a>
</pre>
syntax-end -->
<p>An alias is a name that is only valid in the context of the statement.</p>
<p>Example:</p>
<p class="notranslate">A</p>

<h3 id="and_condition" class="notranslate" onclick="switchBnf(this)">And Condition</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#condition">condition</a> [ { AND <a href="grammar.html#condition">condition</a> } [...] ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#condition">condition</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">AND <a href="grammar.html#condition">condition</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#condition">condition</a> [ { AND <a href="grammar.html#condition">condition</a> } [...] ]
</pre>
syntax-end -->
<p>Value or condition.</p>
<p>Example:</p>
<p class="notranslate">ID=1 AND NAME=&#39;Hi&#39;</p>

<h3 id="case" class="notranslate" onclick="switchBnf(this)">Case</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CASE <a href="grammar.html#expression">expression</a> { WHEN <a href="grammar.html#expression">expression</a> THEN <a href="grammar.html#expression">expression</a> } [...]
[ ELSE <a href="grammar.html#expression">expression</a> ] END
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CASE <a href="grammar.html#expression">expression</a> WHEN <a href="grammar.html#expression">expression</a> THEN <a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ELSE <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">END</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CASE <a href="grammar.html#expression">expression</a> { WHEN <a href="grammar.html#expression">expression</a> THEN <a href="grammar.html#expression">expression</a> } [...]
[ ELSE <a href="grammar.html#expression">expression</a> ] END
</pre>
syntax-end -->
<p>Returns the first expression where the value is equal to the test expression. If no else part is specified, return <code>NULL</code>.</p>
<p>Example:</p>
<p class="notranslate">CASE CNT WHEN 0 THEN &#39;No&#39; WHEN 1 THEN &#39;One&#39; ELSE &#39;Some&#39; END</p>

<h3 id="case_when" class="notranslate" onclick="switchBnf(this)">Case When</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CASE { WHEN <a href="grammar.html#expression">expression</a> THEN <a href="grammar.html#expression">expression</a>} [...]
[ ELSE <a href="grammar.html#expression">expression</a> ] END
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CASE WHEN <a href="grammar.html#expression">expression</a> THEN <a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ELSE <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">END</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CASE { WHEN <a href="grammar.html#expression">expression</a> THEN <a href="grammar.html#expression">expression</a>} [...]
[ ELSE <a href="grammar.html#expression">expression</a> ] END
</pre>
syntax-end -->
<p>Returns the first expression where the condition is true. If no else part is specified, return <code>NULL</code>.</p>
<p>Example:</p>
<p class="notranslate">CASE WHEN CNT&lt;10 THEN &#39;Low&#39; ELSE &#39;High&#39; END</p>

<h3 id="cipher" class="notranslate" onclick="switchBnf(this)">Cipher</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
AES
</pre>
<div name="railroad">
<code class="c">AES</code>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
AES
</pre>
syntax-end -->
<p>Only the algorithm <code>AES</code> (<code>AES-128</code>) is supported currently.</p>
<p>Example:</p>
<p class="notranslate">AES</p>

<h3 id="column_definition" class="notranslate" onclick="switchBnf(this)">Column Definition</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#data_type">dataType</a> [ VISIBLE | INVISIBLE ]
[ { DEFAULT <a href="grammar.html#expression">expression</a>
| AS <a href="grammar.html#expression">computedColumnExpression</a>
| GENERATED {ALWAYS | BY DEFAULT} AS IDENTITY [(<a href="grammar.html#sequence_options">sequenceOptions</a>)]} ]
[ ON UPDATE <a href="grammar.html#expression">expression</a> ] [ [ NOT ] NULL ]
[ { AUTO_INCREMENT | IDENTITY } [ ( <a href="grammar.html#int">startInt</a> [, <a href="grammar.html#int">incrementInt</a> ] ) ] ]
[ SELECTIVITY <a href="grammar.html#int">selectivityInt</a> ] [ COMMENT <a href="grammar.html#expression">expression</a> ]
[ PRIMARY KEY [ HASH ] | UNIQUE ] [ CHECK <a href="grammar.html#condition">condition</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#data_type">dataType</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">VISIBLE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">INVISIBLE</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">DEFAULT <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">AS <a href="grammar.html#expression">computedColumnExpression</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">GENERATED</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">ALWAYS</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">BY DEFAULT</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">AS IDENTITY</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#sequence_options">sequenceOptions</a> )</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ON UPDATE <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">NULL</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">AUTO_INCREMENT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">IDENTITY</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#int">startInt</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="grammar.html#int">incrementInt</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SELECTIVITY <a href="grammar.html#int">selectivityInt</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">COMMENT <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">PRIMARY KEY</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">HASH</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">UNIQUE</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CHECK <a href="grammar.html#condition">condition</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#data_type">dataType</a> [ VISIBLE | INVISIBLE ]
[ { DEFAULT <a href="grammar.html#expression">expression</a>
| AS <a href="grammar.html#expression">computedColumnExpression</a>
| GENERATED {ALWAYS | BY DEFAULT} AS IDENTITY [(<a href="grammar.html#sequence_options">sequenceOptions</a>)]} ]
[ ON UPDATE <a href="grammar.html#expression">expression</a> ] [ [ NOT ] NULL ]
[ { AUTO_INCREMENT | IDENTITY } [ ( <a href="grammar.html#int">startInt</a> [, <a href="grammar.html#int">incrementInt</a> ] ) ] ]
[ SELECTIVITY <a href="grammar.html#int">selectivityInt</a> ] [ COMMENT <a href="grammar.html#expression">expression</a> ]
[ PRIMARY KEY [ HASH ] | UNIQUE ] [ CHECK <a href="grammar.html#condition">condition</a> ]
</pre>
syntax-end -->
<p>Default expressions are used if no explicit value was used when adding a row. The computed column expression is evaluated and assigned whenever the row changes. On update column expression is used if row is updated, at least one column have a new value that is different from its previous value and value for this column is not set explicitly in update statement.</p><p>Identity, auto-increment, or generated as identity columns are columns with a sequence as the default. The column declared as the identity columns with <code>IDENTITY</code> data type or with <code>IDENTITY</code> () clause is implicitly the primary key column of this table. <code>AUTO_INCREMENT</code> and <code>GENERATED</code> clauses do not create the primary key constraint. <code>GENERATED ALWAYS</code> is accepted but treated in the same way as <code>GENERATED BY DEFAULT</code>.</p><p>The invisible column will not be displayed as a result of <code>SELECT</code> * query. Otherwise, it works as normal column.</p><p>The options <code>PRIMARY KEY, UNIQUE</code>, and <code>CHECK</code> are not supported for <code>ALTER</code> statements.</p><p>Check constraints can reference columns of the table, and they can reference objects that exist while the statement is executed. Conditions are only checked when a row is added or modified in the table where the constraint exists.</p>
<p>Example:</p>
<p class="notranslate">CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255) DEFAULT &#39;&#39;);<br />CREATE TABLE TEST(ID BIGINT IDENTITY);<br />CREATE TABLE TEST(QUANTITY INT, PRICE DECIMAL, AMOUNT DECIMAL AS QUANTITY*PRICE);</p>

<h3 id="comments" class="notranslate" onclick="switchBnf(this)">Comments</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
&#45;- anything | // anything | /* anything */
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">- - anything</code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">/ / anything</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">/ * anything * /</code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
&#45;- anything | // anything | /* anything */
</pre>
syntax-end -->
<p>Comments can be used anywhere in a command and are ignored by the database. Line comments end with a newline. Block comments cannot be nested, but can be multiple lines long.</p>
<p>Example:</p>
<p class="notranslate">// This is a comment</p>

<h3 id="compare" class="notranslate" onclick="switchBnf(this)">Compare</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
&lt;&gt; | &lt;= | &gt;= | = | &lt; | &gt; | != | &amp;&amp;
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">&lt; &gt;</code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">&lt; =</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">&gt; =</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">=</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">&lt;</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">&gt;</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">! =</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">&amp;&amp;</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
&lt;&gt; | &lt;= | &gt;= | = | &lt; | &gt; | != | &amp;&amp;
</pre>
syntax-end -->
<p>Comparison operator. The operator != is the same as &lt;&gt;. The operator <code>&amp;&amp;</code> means overlapping; it can only be used with geometry types.</p>
<p>Example:</p>
<p class="notranslate">&lt;&gt;</p>

<h3 id="condition" class="notranslate" onclick="switchBnf(this)">Condition</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#operand">operand</a> [ <a href="grammar.html#condition_right_hand_side">conditionRightHandSide</a> ]
| NOT <a href="grammar.html#condition">condition</a>
| EXISTS ( <a href="grammar.html#query">query</a> )
| UNIQUE ( <a href="grammar.html#query">query</a> )
| INTERSECTS (<a href="grammar.html#operand">operand</a>, <a href="grammar.html#operand">operand</a>)
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#operand">operand</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#condition_right_hand_side">conditionRightHandSide</a></code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NOT <a href="grammar.html#condition">condition</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">EXISTS ( <a href="grammar.html#query">query</a> )</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">UNIQUE ( <a href="grammar.html#query">query</a> )</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">INTERSECTS ( <a href="grammar.html#operand">operand</a> , <a href="grammar.html#operand">operand</a> )</code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#operand">operand</a> [ <a href="grammar.html#condition_right_hand_side">conditionRightHandSide</a> ]
| NOT <a href="grammar.html#condition">condition</a>
| EXISTS ( <a href="grammar.html#query">query</a> )
| UNIQUE ( <a href="grammar.html#query">query</a> )
| INTERSECTS (<a href="grammar.html#operand">operand</a>, <a href="grammar.html#operand">operand</a>)
</pre>
syntax-end -->
<p>Boolean value or condition.</p><p><code>NOT</code> condition negates the result of subcondition and returns <code>TRUE, FALSE</code>, or <code>UNKNOWN</code> (<code>NULL</code>).</p><p><code>EXISTS</code> predicate tests whether the result of the specified subquery is not empty and returns <code>TRUE</code> or <code>FALSE</code>.</p><p><code>UNIQUE</code> predicate tests absence of duplicate rows in the specified subquery and returns <code>TRUE</code> or <code>FALSE</code>. Rows with <code>NULL</code> value in any column are ignored.</p><p><code>INTERSECTS</code> checks whether 2D bounding boxes of specified geometries intersects with each other and returns <code>TRUE</code> or <code>FALSE</code>.</p>
<p>Example:</p>
<p class="notranslate">ID&lt;&gt;2<br />NOT(A OR B)<br />EXISTS (SELECT NULL FROM TEST T WHERE T.GROUP_ID = P.ID)<br />UNIQUE (SELECT A, B FROM TEST T WHERE T.CATEGORY = CAT)<br />INTERSECTS(GEOM1, GEOM2)</p>

<h3 id="condition_right_hand_side" class="notranslate" onclick="switchBnf(this)">Condition Right Hand Side</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#compare">compare</a> { { { ALL | ANY | SOME } ( <a href="grammar.html#query">query</a> ) } | <a href="grammar.html#operand">operand</a> }
| IS [ NOT ] NULL
| IS [ NOT ] [ DISTINCT FROM ] <a href="grammar.html#operand">operand</a>
| IS [ NOT ] { TRUE | FALSE | UNKNOWN }
| IS [ NOT ] OF (<a href="grammar.html#data_type">dataType</a> [,...])
| IS [ NOT ] JSON [ VALUE | ARRAY | OBJECT | SCALAR ]
    [ [ WITH | WITHOUT ] UNIQUE [ KEYS ] ]
| BETWEEN <a href="grammar.html#operand">operand</a> AND <a href="grammar.html#operand">operand</a>
| IN ( { <a href="grammar.html#query">query</a> | <a href="grammar.html#expression">expression</a> [,...] } )
| [ NOT ] [ LIKE | ILIKE ] <a href="grammar.html#operand">operand</a> [ ESCAPE <a href="grammar.html#string">string</a> ]
| [ NOT ] REGEXP <a href="grammar.html#operand">operand</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#compare">compare</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">ALL</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">ANY</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SOME</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">( <a href="grammar.html#query">query</a> )</code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#operand">operand</a></code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">NULL</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">DISTINCT FROM</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#operand">operand</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">TRUE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">FALSE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">UNKNOWN</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">OF ( <a href="grammar.html#data_type">dataType</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">JSON</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">VALUE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">ARRAY</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">OBJECT</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SCALAR</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">WITH</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">WITHOUT</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">UNIQUE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">KEYS</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">BETWEEN <a href="grammar.html#operand">operand</a> AND <a href="grammar.html#operand">operand</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IN (</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#query">query</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">LIKE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">ILIKE</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#operand">operand</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ESCAPE <a href="grammar.html#string">string</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">REGEXP <a href="grammar.html#operand">operand</a></code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#compare">compare</a> { { { ALL | ANY | SOME } ( <a href="grammar.html#query">query</a> ) } | <a href="grammar.html#operand">operand</a> }
| IS [ NOT ] NULL
| IS [ NOT ] [ DISTINCT FROM ] <a href="grammar.html#operand">operand</a>
| IS [ NOT ] { TRUE | FALSE | UNKNOWN }
| IS [ NOT ] OF (<a href="grammar.html#data_type">dataType</a> [,...])
| IS [ NOT ] JSON [ VALUE | ARRAY | OBJECT | SCALAR ]
    [ [ WITH | WITHOUT ] UNIQUE [ KEYS ] ]
| BETWEEN <a href="grammar.html#operand">operand</a> AND <a href="grammar.html#operand">operand</a>
| IN ( { <a href="grammar.html#query">query</a> | <a href="grammar.html#expression">expression</a> [,...] } )
| [ NOT ] [ LIKE | ILIKE ] <a href="grammar.html#operand">operand</a> [ ESCAPE <a href="grammar.html#string">string</a> ]
| [ NOT ] REGEXP <a href="grammar.html#operand">operand</a>
</pre>
syntax-end -->
<p>The right hand side of a condition.</p><p>Quantified comparison predicate <code>ALL</code> returns <code>TRUE</code> if specified comparison operation between left size of condition and each row from a subquery returns <code>TRUE</code>, including case when there are no rows. <code>ALL</code> predicate returns <code>FALSE</code> if at least one such comparison returns <code>FALSE</code>. Otherwise it returns <code>NULL</code>.</p><p>Quantified comparison predicates <code>ANY</code> and <code>SOME</code> return <code>TRUE</code> if specified comparison operation between left size of condition and at least one row from a subquery returns <code>TRUE</code>. <code>ANY</code> and <code>SOME</code> predicates return <code>FALSE</code> if all such comparisons return <code>FALSE</code>. Otherwise it returns <code>NULL</code>. Note that these predicates have priority over <code>ANY</code> and <code>SOME</code> aggregate functions with subquery on the right side. Use parentheses around aggregate function.</p><p>The conditions <code>IS [ NOT ] NULL</code> check whether the specified value(s) are <code>NULL</code> values. To test multiple values a row value must be specified. <code>IS NULL</code> returns <code>TRUE</code> if and only if all values are <code>NULL</code> values; otherwise it returns <code>FALSE</code>. <code>IS NOT NULL</code> returns <code>TRUE</code> if and only if all values are not <code>NULL</code> values; otherwise it returns <code>FALSE</code>.</p><p>The conditions <code>IS [ NOT ] DISTINCT FROM</code> are null-safe, meaning <code>NULL</code> is considered the same as <code>NULL</code>, and the condition never evaluates to <code>NULL</code>.</p><p>Boolean tests <code>IS [ NOT ] { TRUE | FALSE | UNKNOWN }</code> check whether the specified value is (not) <code>TRUE, FALSE</code>, or <code>UNKNOWN</code> (<code>NULL</code>) and return <code>TRUE</code> or <code>FALSE</code>.</p><p>The conditions <code>IS [ NOT ] OF</code> check whether the data type of the specified operand is one of the specified data types. Some data types have multiple names, these names are considered as equal here. Domains and their base data types are currently not distinguished from each other. Precision and scale are also ignored. If operand is <code>NULL</code>, the result is <code>NULL</code>.</p><p>The conditions <code>IS [ NOT ] JSON</code> check whether value of the specified string, binary data, or a <code>JSON</code> is a valid <code>JSON</code>. If <code>ARRAY, OBJECT</code>, or <code>SCALAR</code> is specified, only <code>JSON</code> items of the specified type are considered as valid. If <code>WITH UNIQUE [ KEYS ]</code> is specified only <code>JSON</code> with unique keys is considered as valid. These conditions aren&#39;t null-safe, they return <code>NULL</code> if operand is <code>NULL</code>.</p><p>When comparing with <code>LIKE</code>, the wildcards characters are <code>_</code> (any one character) and <code>%</code> (any characters). The database uses an index when comparing with <code>LIKE</code> except if the operand starts with a wildcard. To search for the characters <code>%</code> and <code>_</code>, the characters need to be escaped. The default escape character is <code> \ </code> (backslash). To select no escape character, use <code>ESCAPE &#39;&#39;</code> (empty string). At most one escape character is allowed. Each character that follows the escape character in the pattern needs to match exactly. Patterns that end with an escape character are invalid and the expression returns <code>NULL</code>.</p><p><code>ILIKE</code> does a case-insensitive compare.</p><p>When comparing with <code>REGEXP</code>, regular expression matching is used. See Java <code>Matcher.find</code> for details.</p>
<p>Example:</p>
<p class="notranslate">VALUE &gt; 10<br />A IS NULL<br />(A, B) IS NOT NULL<br />A IS NOT DISTINCT FROM B<br />T IS OF (DATE, TIMESTAMP, TIMESTAMP WITH TIME ZONE)<br />T IS JSON OBJECT WITH UNIQUE KEYS<br />LIKE &#39;Jo%&#39;</p>

<h3 id="constraint" class="notranslate" onclick="switchBnf(this)">Constraint</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
[ <a href="grammar.html#constraint_name_definition">constraintNameDefinition</a> ]
{ CHECK <a href="grammar.html#expression">expression</a>
| UNIQUE ( <a href="grammar.html#name">columnName</a> [,...] )
| <a href="grammar.html#referential_constraint">referentialConstraint</a>
| PRIMARY KEY [ HASH ] ( <a href="grammar.html#name">columnName</a> [,...] ) }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#constraint_name_definition">constraintNameDefinition</a></code></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CHECK <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">UNIQUE ( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#referential_constraint">referentialConstraint</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">PRIMARY KEY</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">HASH</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ <a href="grammar.html#constraint_name_definition">constraintNameDefinition</a> ]
{ CHECK <a href="grammar.html#expression">expression</a>
| UNIQUE ( <a href="grammar.html#name">columnName</a> [,...] )
| <a href="grammar.html#referential_constraint">referentialConstraint</a>
| PRIMARY KEY [ HASH ] ( <a href="grammar.html#name">columnName</a> [,...] ) }
</pre>
syntax-end -->
<p>Defines a constraint. The check condition must evaluate to <code>TRUE, FALSE</code> or <code>NULL</code>. <code>TRUE</code> and <code>NULL</code> mean the operation is to be permitted, and <code>FALSE</code> means the operation is to be rejected. To prevent <code>NULL</code> in a column, use <code>NOT NULL</code> instead of a check constraint.</p>
<p>Example:</p>
<p class="notranslate">PRIMARY KEY(ID, NAME)</p>

<h3 id="constraint_name_definition" class="notranslate" onclick="switchBnf(this)">Constraint Name Definition</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CONSTRAINT [ IF NOT EXISTS ] <a href="grammar.html#name">newConstraintName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CONSTRAINT</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newConstraintName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CONSTRAINT [ IF NOT EXISTS ] <a href="grammar.html#name">newConstraintName</a>
</pre>
syntax-end -->
<p>Defines a constraint name.</p>
<p>Example:</p>
<p class="notranslate">CONSTRAINT CONST_ID</p>

<h3 id="csv_options" class="notranslate" onclick="switchBnf(this)">Csv Options</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#string">charsetString</a> [, <a href="grammar.html#string">fieldSepString</a> [, <a href="grammar.html#string">fieldDelimString</a> [, <a href="grammar.html#string">escString</a> [, <a href="grammar.html#string">nullString</a>]]]]]
| <a href="grammar.html#string">optionString</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#string">charsetString</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="grammar.html#string">fieldSepString</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="grammar.html#string">fieldDelimString</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="grammar.html#string">escString</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="grammar.html#string">nullString</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#string">charsetString</a> [, <a href="grammar.html#string">fieldSepString</a> [, <a href="grammar.html#string">fieldDelimString</a> [, <a href="grammar.html#string">escString</a> [, <a href="grammar.html#string">nullString</a>]]]]]
| <a href="grammar.html#string">optionString</a>
</pre>
syntax-end -->
<p>Optional parameters for <code>CSVREAD</code> and <code>CSVWRITE</code>. Instead of setting the options one by one, all options can be combined into a space separated key-value pairs, as follows: <code>STRINGDECODE(&#39;charset=UTF-8 escape=\" fieldDelimiter=\" fieldSeparator=, &#39; || &#39;lineComment=# lineSeparator=\n null= rowSeparator=&#39;)</code>. The following options are supported:</p><p><code>caseSensitiveColumnNames</code> (true or false; disabled by default),</p><p><code>charset</code> (for example &#39;<code>UTF</code>-8&#39;),</p><p><code>escape</code> (the character that escapes the field delimiter),</p><p><code>fieldDelimiter</code> (a double quote by default),</p><p><code>fieldSeparator</code> (a comma by default),</p><p><code>lineComment</code> (disabled by default),</p><p><code>lineSeparator</code> (the line separator used for writing; ignored for reading),</p><p><code>null</code>, Support reading existing <code>CSV</code> files that contain explicit <code>null</code> delimiters. Note that an empty, unquoted values are also treated as null.</p><p><code>preserveWhitespace</code> (true or false; disabled by default),</p><p><code>writeColumnHeader</code> (true or false; enabled by default).</p><p>For a newline or other special character, use <code>STRINGDECODE</code> as in the example above. A space needs to be escaped with a backslash (<code>&#39;\ &#39;</code>), and a backslash needs to be escaped with another backslash (<code>&#39;\\&#39;</code>). All other characters are not to be escaped, that means newline and tab characters are written as such.</p>
<p>Example:</p>
<p class="notranslate">CALL CSVWRITE(&#39;test2.csv&#39;, &#39;SELECT * FROM TEST&#39;, &#39;charset=UTF-8 fieldSeparator=|&#39;);</p>

<h3 id="data_change_delta_table" class="notranslate" onclick="switchBnf(this)">Data Change Delta Table</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
{ OLD | NEW | FINAL } TABLE
( { <a href="commands.html#insert">insert</a> | <a href="commands.html#update">update</a> | <a href="commands.html#delete">delete</a> | <a href="commands.html#merge_into">mergeInto</a> | <a href="commands.html#merge_using">mergeUsing</a> } )
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">OLD</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">NEW</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">FINAL</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">TABLE</code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><code class="c">(</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="commands.html#insert">insert</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="commands.html#update">update</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="commands.html#delete">delete</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="commands.html#merge_into">mergeInto</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="commands.html#merge_using">mergeUsing</a></code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ OLD | NEW | FINAL } TABLE
( { <a href="commands.html#insert">insert</a> | <a href="commands.html#update">update</a> | <a href="commands.html#delete">delete</a> | <a href="commands.html#merge_into">mergeInto</a> | <a href="commands.html#merge_using">mergeUsing</a> } )
</pre>
syntax-end -->
<p>Executes the inner data change command and returns old, new, or final rows.</p><p><code>OLD</code> is not allowed for <code>INSERT</code> command. It returns old rows.</p><p><code>NEW</code> and <code>FINAL</code> are not allowed for <code>DELETE</code> command.</p><p><code>NEW</code> returns new rows after evaluation of default expressions, but before execution of triggers.</p><p><code>FINAL</code> returns new rows after execution of triggers. If table or view has <code>INSTEAD OF</code> triggers <code>FINAL</code> is not allowed.</p>
<p>Example:</p>
<p class="notranslate">SELECT ID FROM FINAL TABLE (INSERT INTO TEST (A, B) VALUES (1, 2))</p>

<h3 id="data_type" class="notranslate" onclick="switchBnf(this)">Data Type</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="datatypes.html#int_type">intType</a> | <a href="datatypes.html#boolean_type">booleanType</a> | <a href="datatypes.html#tinyint_type">tinyintType</a> | <a href="datatypes.html#smallint_type">smallintType</a> | <a href="datatypes.html#bigint_type">bigintType</a> | <a href="datatypes.html#identity_type">identityType</a>
| <a href="datatypes.html#decimal_type">decimalType</a> | <a href="datatypes.html#double_type">doubleType</a> | <a href="datatypes.html#real_type">realType</a> | <a href="datatypes.html#date_type">dateType</a> | <a href="datatypes.html#time_type">timeType</a>
| <a href="datatypes.html#time_with_time_zone_type">timeWithTimeZoneType</a> | <a href="datatypes.html#timestamp_type">timestampType</a> | <a href="datatypes.html#timestamp_with_time_zone_type">timestampWithTimeZoneType</a>
| <a href="datatypes.html#binary_type">binaryType</a> | <a href="datatypes.html#other_type">otherType</a> | <a href="datatypes.html#varchar_type">varcharType</a> | <a href="datatypes.html#varchar_ignorecase_type">varcharIgnorecaseType</a> | <a href="datatypes.html#char_type">charType</a>
| <a href="datatypes.html#blob_type">blobType</a> | <a href="datatypes.html#clob_type">clobType</a> | <a href="datatypes.html#uuid_type">uuidType</a> | <a href="datatypes.html#array_type">arrayType</a> | <a href="datatypes.html#enum_type">enumType</a> | <a href="datatypes.html#interval_type">intervalType</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="datatypes.html#int_type">intType</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#boolean_type">booleanType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#tinyint_type">tinyintType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#smallint_type">smallintType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#bigint_type">bigintType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#identity_type">identityType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#decimal_type">decimalType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#double_type">doubleType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#real_type">realType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#date_type">dateType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#time_type">timeType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#time_with_time_zone_type">timeWithTimeZoneType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#timestamp_type">timestampType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#timestamp_with_time_zone_type">timestampWithTimeZoneType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#binary_type">binaryType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#other_type">otherType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#varchar_type">varcharType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#varchar_ignorecase_type">varcharIgnorecaseType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#char_type">charType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#blob_type">blobType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#clob_type">clobType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#uuid_type">uuidType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#array_type">arrayType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#enum_type">enumType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="datatypes.html#interval_type">intervalType</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="datatypes.html#int_type">intType</a> | <a href="datatypes.html#boolean_type">booleanType</a> | <a href="datatypes.html#tinyint_type">tinyintType</a> | <a href="datatypes.html#smallint_type">smallintType</a> | <a href="datatypes.html#bigint_type">bigintType</a> | <a href="datatypes.html#identity_type">identityType</a>
| <a href="datatypes.html#decimal_type">decimalType</a> | <a href="datatypes.html#double_type">doubleType</a> | <a href="datatypes.html#real_type">realType</a> | <a href="datatypes.html#date_type">dateType</a> | <a href="datatypes.html#time_type">timeType</a>
| <a href="datatypes.html#time_with_time_zone_type">timeWithTimeZoneType</a> | <a href="datatypes.html#timestamp_type">timestampType</a> | <a href="datatypes.html#timestamp_with_time_zone_type">timestampWithTimeZoneType</a>
| <a href="datatypes.html#binary_type">binaryType</a> | <a href="datatypes.html#other_type">otherType</a> | <a href="datatypes.html#varchar_type">varcharType</a> | <a href="datatypes.html#varchar_ignorecase_type">varcharIgnorecaseType</a> | <a href="datatypes.html#char_type">charType</a>
| <a href="datatypes.html#blob_type">blobType</a> | <a href="datatypes.html#clob_type">clobType</a> | <a href="datatypes.html#uuid_type">uuidType</a> | <a href="datatypes.html#array_type">arrayType</a> | <a href="datatypes.html#enum_type">enumType</a> | <a href="datatypes.html#interval_type">intervalType</a>
</pre>
syntax-end -->
<p>A data type definition.</p>
<p>Example:</p>
<p class="notranslate">INT</p>

<h3 id="digit" class="notranslate" onclick="switchBnf(this)">Digit</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
0-9
</pre>
<div name="railroad">
<code class="c">0-9</code>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
0-9
</pre>
syntax-end -->
<p>A digit.</p>
<p>Example:</p>
<p class="notranslate">0</p>

<h3 id="expression" class="notranslate" onclick="switchBnf(this)">Expression</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#and_condition">andCondition</a> [ { OR <a href="grammar.html#and_condition">andCondition</a> } [...] ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#and_condition">andCondition</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">OR <a href="grammar.html#and_condition">andCondition</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#and_condition">andCondition</a> [ { OR <a href="grammar.html#and_condition">andCondition</a> } [...] ]
</pre>
syntax-end -->
<p>Value or condition.</p>
<p>Example:</p>
<p class="notranslate">ID=1 OR NAME=&#39;Hi&#39;</p>

<h3 id="factor" class="notranslate" onclick="switchBnf(this)">Factor</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#term">term</a> [ { { * | / | % } <a href="grammar.html#term">term</a> } [...] ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#term">term</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">*</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">/</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">%</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#term">term</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#term">term</a> [ { { * | / | % } <a href="grammar.html#term">term</a> } [...] ]
</pre>
syntax-end -->
<p>A value or a numeric factor.</p>
<p>Example:</p>
<p class="notranslate">ID * 10</p>

<h3 id="grouping_element" class="notranslate" onclick="switchBnf(this)">Grouping element</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#expression">expression</a> | (<a href="grammar.html#expression">expression</a> [, ...]) | ()
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, ...</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( )</code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#expression">expression</a> | (<a href="grammar.html#expression">expression</a> [, ...]) | ()
</pre>
syntax-end -->
<p>A grouping element of <code>GROUP BY</code> clause.</p>
<p>Example:</p>
<p class="notranslate">A<br />(B, C)<br />()</p>

<h3 id="hex" class="notranslate" onclick="switchBnf(this)">Hex</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
[&#39; &#39; [...]] { { <a href="grammar.html#digit">digit</a> | a-f | A-F } [&#39; &#39; [...]] { <a href="grammar.html#digit">digit</a> | a-f | A-F } [&#39; &#39; [...]] } [...]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">&#39; &#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#digit">digit</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">a - f</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">A-F</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">&#39; &#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#digit">digit</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">a - f</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">A-F</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">&#39; &#39;</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[&#39; &#39; [...]] { { <a href="grammar.html#digit">digit</a> | a-f | A-F } [&#39; &#39; [...]] { <a href="grammar.html#digit">digit</a> | a-f | A-F } [&#39; &#39; [...]] } [...]
</pre>
syntax-end -->
<p>The hexadecimal representation of a number or of bytes with optional space characters. Two hexadecimal digit characters are one byte.</p>
<p>Example:</p>
<p class="notranslate">cafe<br />11 22 33<br />a b &nbsp;c d</p>

<h3 id="index_column" class="notranslate" onclick="switchBnf(this)">Index Column</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#name">columnName</a> [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">ASC</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DESC</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NULLS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">FIRST</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">LAST</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#name">columnName</a> [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
</pre>
syntax-end -->
<p>Indexes this column in ascending or descending order. Usually it is not required to specify the order; however doing so will speed up large queries that order the column in the same way.</p>
<p>Example:</p>
<p class="notranslate">NAME</p>

<h3 id="insert_columns_and_source" class="notranslate" onclick="switchBnf(this)">Insert columns and source</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
{ [ ( <a href="grammar.html#name">columnName</a> [,...] ) ]
{ <a href="grammar.html#insert_values">insertValues</a> | [ DIRECT ] [ SORTED ] <a href="grammar.html#query">query</a> | DEFAULT VALUES } }
| { SET { <a href="grammar.html#name">columnName</a> = { DEFAULT | <a href="grammar.html#expression">expression</a> } } [,...] }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#insert_values">insertValues</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DIRECT</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SORTED</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#query">query</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">DEFAULT VALUES</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET <a href="grammar.html#name">columnName</a> =</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFAULT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ [ ( <a href="grammar.html#name">columnName</a> [,...] ) ]
{ <a href="grammar.html#insert_values">insertValues</a> | [ DIRECT ] [ SORTED ] <a href="grammar.html#query">query</a> | DEFAULT VALUES } }
| { SET { <a href="grammar.html#name">columnName</a> = { DEFAULT | <a href="grammar.html#expression">expression</a> } } [,...] }
</pre>
syntax-end -->
<p>Names of columns and their values for <code>INSERT</code> statement.</p>
<p>Example:</p>
<p class="notranslate">(ID, NAME) VALUES (1, &#39;Test&#39;)</p>

<h3 id="insert_values" class="notranslate" onclick="switchBnf(this)">Insert values</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
VALUES { DEFAULT|<a href="grammar.html#expression">expression</a> | [ROW] ({DEFAULT|<a href="grammar.html#expression">expression</a>} [,...]) }, [,...]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">VALUES</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFAULT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">ROW</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">(</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFAULT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">,</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
VALUES { DEFAULT|<a href="grammar.html#expression">expression</a> | [ROW] ({DEFAULT|<a href="grammar.html#expression">expression</a>} [,...]) }, [,...]
</pre>
syntax-end -->
<p>Values for <code>INSERT</code> statement.</p>
<p>Example:</p>
<p class="notranslate">VALUES (1, &#39;Test&#39;)</p>

<h3 id="join_specification" class="notranslate" onclick="switchBnf(this)">Join specification</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ON <a href="grammar.html#expression">expression</a> | USING (<a href="grammar.html#name">columnName</a> [,...])
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ON <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">USING ( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ON <a href="grammar.html#expression">expression</a> | USING (<a href="grammar.html#name">columnName</a> [,...])
</pre>
syntax-end -->
<p>Specifies a join condition or column names.</p>
<p>Example:</p>
<p class="notranslate">ON B.ID = A.PARENT_ID<br />USING (ID)</p>

<h3 id="merge_when_clause" class="notranslate" onclick="switchBnf(this)">Merge when clause</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#merge_when_matched_clause">mergeWhenMatchedClause</a>|<a href="grammar.html#merge_when_not_matched_clause">mergeWhenNotMatchedClause</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#merge_when_matched_clause">mergeWhenMatchedClause</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#merge_when_not_matched_clause">mergeWhenNotMatchedClause</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#merge_when_matched_clause">mergeWhenMatchedClause</a>|<a href="grammar.html#merge_when_not_matched_clause">mergeWhenNotMatchedClause</a>
</pre>
syntax-end -->
<p><code>WHEN MATCHED</code> or <code>WHEN NOT MATCHED</code> clause for <code>MERGE USING</code> command.</p>
<p>Example:</p>
<p class="notranslate">WHEN MATCHED THEN DELETE</p>

<h3 id="merge_when_matched_clause" class="notranslate" onclick="switchBnf(this)">Merge when matched clause</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
WHEN MATCHED [ AND <a href="grammar.html#expression">expression</a> ] THEN
UPDATE SET <a href="grammar.html#set_clause_list">setClauseList</a>
| DELETE
| {UPDATE SET <a href="grammar.html#set_clause_list">setClauseList</a> [ WHERE <a href="grammar.html#expression">expression</a> ] DELETE [ WHERE <a href="grammar.html#expression">expression</a> ]}
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">WHEN MATCHED</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">AND <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">THEN</code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">UPDATE SET <a href="grammar.html#set_clause_list">setClauseList</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">DELETE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">UPDATE SET <a href="grammar.html#set_clause_list">setClauseList</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">WHERE <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">DELETE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">WHERE <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
WHEN MATCHED [ AND <a href="grammar.html#expression">expression</a> ] THEN
UPDATE SET <a href="grammar.html#set_clause_list">setClauseList</a>
| DELETE
| {UPDATE SET <a href="grammar.html#set_clause_list">setClauseList</a> [ WHERE <a href="grammar.html#expression">expression</a> ] DELETE [ WHERE <a href="grammar.html#expression">expression</a> ]}
</pre>
syntax-end -->
<p><code>WHEN MATCHED</code> clause for <code>MERGE USING</code> command.</p><p>If both <code>UPDATE</code> and <code>DELETE</code> are specified, <code>DELETE</code> can delete only rows that were updated, <code>WHERE</code> condition in <code>DELETE</code> clause can be used to specify which updated rows should be deleted. This condition checks values in updated row. Such combination of <code>UPDATE</code> and <code>DELETE</code> clauses in single <code>WHEN MATCHED</code> clause is not allowed when <code>MERGE</code> statement is included into data change delta table.</p>
<p>Example:</p>
<p class="notranslate">WHEN MATCHED THEN UPDATE SET VALUE = S.VALUE<br />WHEN MATCHED THEN DELETE</p>

<h3 id="merge_when_not_matched_clause" class="notranslate" onclick="switchBnf(this)">Merge when not matched clause</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
WHEN NOT MATCHED [ AND <a href="grammar.html#expression">expression</a> ] THEN INSERT <a href="grammar.html#insert_columns_and_source">insertColumnsAndSource</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">WHEN NOT MATCHED</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">AND <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">THEN INSERT <a href="grammar.html#insert_columns_and_source">insertColumnsAndSource</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
WHEN NOT MATCHED [ AND <a href="grammar.html#expression">expression</a> ] THEN INSERT <a href="grammar.html#insert_columns_and_source">insertColumnsAndSource</a>
</pre>
syntax-end -->
<p><code>WHEN NOT MATCHED</code> clause for <code>MERGE USING</code> command.</p>
<p>Example:</p>
<p class="notranslate">WHEN NOT MATCHED THEN INSERT (ID, NAME) VALUES (S.ID, S.NAME)</p>

<h3 id="name" class="notranslate" onclick="switchBnf(this)">Name</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
{ { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | <a href="grammar.html#quoted_name">quotedName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">A-Z | _</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">A-Z | _</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">0-9</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#quoted_name">quotedName</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | <a href="grammar.html#quoted_name">quotedName</a>
</pre>
syntax-end -->
<p>With default settings unquoted names are converted to upper case. There is no maximum name length.</p><p>Identifiers in H2 are case sensitive by default. Because unquoted names are converted to upper case, they can be written in any case anyway. When both quoted and unquoted names are used for the same identifier the quoted names must be written in upper case. Identifiers with lowercase characters can be written only as a quoted name, they aren&#39;t accessible with unquoted names.</p><p>If <code>DATABASE_TO_UPPER</code> setting is set to <code>FALSE</code> the unquoted names aren&#39;t converted to upper case.</p><p>If <code>DATABASE_TO_LOWER</code> setting is set to <code>TRUE</code> the unquoted names are converted to lower case instead.</p><p>If <code>CASE_INSENSITIVE_IDENTIFIERS</code> setting is set to <code>TRUE</code> all identifiers are case insensitive.</p>
<p>Example:</p>
<p class="notranslate">TEST</p>

<h3 id="operand" class="notranslate" onclick="switchBnf(this)">Operand</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#summand">summand</a> [ { || <a href="grammar.html#summand">summand</a> } [...] ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#summand">summand</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">|| <a href="grammar.html#summand">summand</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#summand">summand</a> [ { || <a href="grammar.html#summand">summand</a> } [...] ]
</pre>
syntax-end -->
<p>Performs the concatenation of character string, binary string, or array values. In the default mode, the result is <code>NULL</code> if either parameter is <code>NULL</code>. In compatibility modes result of string concatenation with <code>NULL</code> parameter can be different.</p>
<p>Example:</p>
<p class="notranslate">&#39;Hi&#39; || &#39; Eva&#39;<br />X&#39;AB&#39; || X&#39;CD&#39;<br />ARRAY[1, 2] || 3<br />1 || ARRAY[2, 3]<br />ARRAY[1, 2] || ARRAY[3, 4]</p>

<h3 id="order" class="notranslate" onclick="switchBnf(this)">Order</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
{ <a href="grammar.html#int">int</a> | <a href="grammar.html#expression">expression</a> } [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#int">int</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">ASC</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DESC</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NULLS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">FIRST</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">LAST</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ <a href="grammar.html#int">int</a> | <a href="grammar.html#expression">expression</a> } [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
</pre>
syntax-end -->
<p>Sorts the result by the given column number, or by an expression. If the expression is a single parameter, then the value is interpreted as a column number. Negative column numbers reverse the sort order.</p>
<p>Example:</p>
<p class="notranslate">NAME DESC NULLS LAST</p>

<h3 id="query" class="notranslate" onclick="switchBnf(this)">Query</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="commands.html#select">select</a> | <a href="commands.html#explicit_table">explicitTable</a> | <a href="commands.html#table_value">tableValue</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="commands.html#select">select</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="commands.html#explicit_table">explicitTable</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="commands.html#table_value">tableValue</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="commands.html#select">select</a> | <a href="commands.html#explicit_table">explicitTable</a> | <a href="commands.html#table_value">tableValue</a>
</pre>
syntax-end -->
<p>A query, such as <code>SELECT</code>, explicit table, or table value.</p>
<p>Example:</p>
<p class="notranslate">SELECT ID FROM TEST;<br />TABLE TEST;<br />VALUES (1, 2), (3, 4);</p>

<h3 id="quoted_name" class="notranslate" onclick="switchBnf(this)">Quoted Name</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
&quot;anything&quot;
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">&quot; anything &quot;</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
&quot;anything&quot;
</pre>
syntax-end -->
<p>Case of characters in quoted names is preserved as is. Such names can contain spaces. There is no maximum name length. Two double quotes can be used to create a single double quote inside an identifier. With default settings identifiers in H2 are case sensitive.</p>
<p>Example:</p>
<p class="notranslate">&quot;FirstName&quot;</p>

<h3 id="referential_constraint" class="notranslate" onclick="switchBnf(this)">Referential Constraint</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
FOREIGN KEY ( <a href="grammar.html#name">columnName</a> [,...] )
REFERENCES [ <a href="grammar.html#name">refTableName</a> ] [ ( <a href="grammar.html#name">refColumnName</a> [,...] ) ]
[ ON DELETE <a href="grammar.html#referential_action">referentialAction</a> ] [ ON UPDATE <a href="grammar.html#referential_action">referentialAction</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">FOREIGN KEY ( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><code class="c">REFERENCES</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#name">refTableName</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#name">refColumnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ON DELETE <a href="grammar.html#referential_action">referentialAction</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ON UPDATE <a href="grammar.html#referential_action">referentialAction</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
FOREIGN KEY ( <a href="grammar.html#name">columnName</a> [,...] )
REFERENCES [ <a href="grammar.html#name">refTableName</a> ] [ ( <a href="grammar.html#name">refColumnName</a> [,...] ) ]
[ ON DELETE <a href="grammar.html#referential_action">referentialAction</a> ] [ ON UPDATE <a href="grammar.html#referential_action">referentialAction</a> ]
</pre>
syntax-end -->
<p>Defines a referential constraint. If the table name is not specified, then the same table is referenced. <code>RESTRICT</code> is the default action. If the referenced columns are not specified, then the primary key columns are used. The required indexes are automatically created if required. Some tables may not be referenced, such as metadata tables.</p>
<p>Example:</p>
<p class="notranslate">FOREIGN KEY(ID) REFERENCES TEST(ID)</p>

<h3 id="referential_action" class="notranslate" onclick="switchBnf(this)">Referential Action</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CASCADE | RESTRICT | NO ACTION | SET { DEFAULT | NULL }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">CASCADE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">RESTRICT</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NO ACTION</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFAULT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NULL</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CASCADE | RESTRICT | NO ACTION | SET { DEFAULT | NULL }
</pre>
syntax-end -->
<p>The action <code>CASCADE</code> will cause conflicting rows in the referencing (child) table to be deleted or updated. <code>RESTRICT</code> is the default action. As this database does not support deferred checking, <code>RESTRICT</code> and <code>NO ACTION</code> will both throw an exception if the constraint is violated. The action <code>SET DEFAULT</code> will set the column in the referencing (child) table to the default value, while <code>SET NULL</code> will set it to <code>NULL</code>.</p>
<p>Example:</p>
<p class="notranslate">FOREIGN KEY(ID) REFERENCES TEST(ID) ON UPDATE CASCADE</p>

<h3 id="script_compression_encryption" class="notranslate" onclick="switchBnf(this)">Script Compression Encryption</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
[ COMPRESSION { DEFLATE | LZF | ZIP | GZIP } ]
[ CIPHER <a href="grammar.html#cipher">cipher</a> PASSWORD <a href="grammar.html#string">string</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">COMPRESSION</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFLATE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">LZF</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">ZIP</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">GZIP</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CIPHER <a href="grammar.html#cipher">cipher</a> PASSWORD <a href="grammar.html#string">string</a></code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ COMPRESSION { DEFLATE | LZF | ZIP | GZIP } ]
[ CIPHER <a href="grammar.html#cipher">cipher</a> PASSWORD <a href="grammar.html#string">string</a> ]
</pre>
syntax-end -->
<p>The compression and encryption algorithm to use for script files. When using encryption, only <code>DEFLATE</code> and <code>LZF</code> are supported. <code>LZF</code> is faster but uses more space.</p>
<p>Example:</p>
<p class="notranslate">COMPRESSION LZF</p>

<h3 id="row_value_expression" class="notranslate" onclick="switchBnf(this)">Row value expression</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ROW (<a href="grammar.html#expression">expression</a>, [,...])
| ( [ <a href="grammar.html#expression">expression</a>, <a href="grammar.html#expression">expression</a> [,...] ] )
| <a href="grammar.html#expression">expression</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ROW ( <a href="grammar.html#expression">expression</a> ,</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">(</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#expression">expression</a> , <a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ROW (<a href="grammar.html#expression">expression</a>, [,...])
| ( [ <a href="grammar.html#expression">expression</a>, <a href="grammar.html#expression">expression</a> [,...] ] )
| <a href="grammar.html#expression">expression</a>
</pre>
syntax-end -->
<p>A row value expression.</p>
<p>Example:</p>
<p class="notranslate">ROW (1)<br />(1, 2)<br />1</p>

<h3 id="select_expression" class="notranslate" onclick="switchBnf(this)">Select Expression</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#wildcard_expression">wildcardExpression</a> | <a href="grammar.html#expression">expression</a> [ [ AS ] <a href="grammar.html#alias">columnAlias</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#wildcard_expression">wildcardExpression</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">AS</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#alias">columnAlias</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#wildcard_expression">wildcardExpression</a> | <a href="grammar.html#expression">expression</a> [ [ AS ] <a href="grammar.html#alias">columnAlias</a> ]
</pre>
syntax-end -->
<p>An expression in a <code>SELECT</code> statement.</p>
<p>Example:</p>
<p class="notranslate">ID AS VALUE</p>

<h3 id="sequence_value_expression" class="notranslate" onclick="switchBnf(this)">Sequence value expression</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
{ NEXT | CURRENT } VALUE FOR [<a href="grammar.html#name">schemaName</a>.]<a href="grammar.html#name">sequenceName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">NEXT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">CURRENT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">VALUE FOR</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">schemaName</a> .</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">sequenceName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ NEXT | CURRENT } VALUE FOR [<a href="grammar.html#name">schemaName</a>.]<a href="grammar.html#name">sequenceName</a>
</pre>
syntax-end -->
<p>The next or current value of a sequence.</p><p>When the next value is requested the sequence is incremented and the current value of the sequence and the last identity in the current session are updated with the generated value. Used values are never re-used, even when the transaction is rolled back.</p><p>Current value may only be requested after generation of the sequence value in the current session. It returns the latest generated value for the current session.</p><p>If a single command contains next and current value expressions for the same sequence there is no guarantee that the next value expression will be evaluated before the evaluation of current value expression.</p>
<p>Example:</p>
<p class="notranslate">NEXT VALUE FOR SEQ1<br />CURRENT VALUE FOR SCHEMA2.SEQ2</p>

<h3 id="sequence_options" class="notranslate" onclick="switchBnf(this)">Sequence options</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#sequence_option">sequenceOption</a> [...]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#sequence_option">sequenceOption</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#sequence_option">sequenceOption</a> [...]
</pre>
syntax-end -->
<p>Options of a sequence.</p>
<p>Example:</p>
<p class="notranslate">START WITH 1<br />START WITH 10 INCREMENT BY 10</p>

<h3 id="sequence_option" class="notranslate" onclick="switchBnf(this)">Sequence option</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
{ START | RESTART } WITH <a href="grammar.html#long">long</a>
| INCREMENT BY <a href="grammar.html#long">long</a>
| MINVALUE <a href="grammar.html#long">long</a> | NO MINVALUE | NOMINVALUE
| MAXVALUE <a href="grammar.html#long">long</a> | NO MAXVALUE | NOMAXVALUE
| CYCLE | NO CYCLE | NOCYCLE
| CACHE <a href="grammar.html#long">long</a> | NO CACHE | NOCACHE
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">START</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">RESTART</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">WITH <a href="grammar.html#long">long</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">INCREMENT BY <a href="grammar.html#long">long</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">MINVALUE <a href="grammar.html#long">long</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NO MINVALUE</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">NOMINVALUE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">MAXVALUE <a href="grammar.html#long">long</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NO MAXVALUE</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">NOMAXVALUE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">CYCLE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NO CYCLE</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">NOCYCLE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CACHE <a href="grammar.html#long">long</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NO CACHE</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOCACHE</code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ START | RESTART } WITH <a href="grammar.html#long">long</a>
| INCREMENT BY <a href="grammar.html#long">long</a>
| MINVALUE <a href="grammar.html#long">long</a> | NO MINVALUE | NOMINVALUE
| MAXVALUE <a href="grammar.html#long">long</a> | NO MAXVALUE | NOMAXVALUE
| CYCLE | NO CYCLE | NOCYCLE
| CACHE <a href="grammar.html#long">long</a> | NO CACHE | NOCACHE
</pre>
syntax-end -->
<p>Option of a sequence.</p><p><code>START WITH</code> and <code>RESTART WITH</code> are used to set the first generated value of the sequence. <code>START WITH</code> may only be used in <code>CREATE SEQUENCE</code> command and it column definition, <code>RESTART WITH</code> may only be used in <code>ALTER SEQUENCE</code> command. The default is <code>MINVALUE</code> for incrementing sequences and <code>MAXVALUE</code> for decrementing sequences.</p><p><code>INCREMENT BY</code> specifies the step of the sequence, may be positive or negative, but may not be zero. The default is 1.</p><p><code>MINVALUE</code> and <code>MAXVALUE</code> specify the bounds of the sequence.</p><p>Sequences with <code>CYCLE</code> option start the generation again from <code>MINVALUE</code> (incrementing sequences) or <code>MAXVALUE</code> (decrementing sequences) instead of exhausting with an error.</p><p>The <code>CACHE</code> option sets the number of pre-allocated numbers. If the system crashes without closing the database, at most this many numbers are lost. The default cache size is 32. <code>NO CACHE</code> option or the cache size 1 or lower disable the cache.</p>
<p>Example:</p>
<p class="notranslate">START WITH 10000<br />CYCLE<br />NO CACHE</p>

<h3 id="set_clause_list" class="notranslate" onclick="switchBnf(this)">Set clause list</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
{ { <a href="grammar.html#name">columnName</a> = { DEFAULT | <a href="grammar.html#expression">expression</a> } }
| { ( <a href="grammar.html#name">columnName</a> [,...] ) = { <a href="grammar.html#row_value_expression">rowValueExpression</a> | (<a href="grammar.html#query">query</a>) } } } [,...]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">columnName</a> =</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFAULT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">) =</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#row_value_expression">rowValueExpression</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#query">query</a> )</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ { <a href="grammar.html#name">columnName</a> = { DEFAULT | <a href="grammar.html#expression">expression</a> } }
| { ( <a href="grammar.html#name">columnName</a> [,...] ) = { <a href="grammar.html#row_value_expression">rowValueExpression</a> | (<a href="grammar.html#query">query</a>) } } } [,...]
</pre>
syntax-end -->
<p>List of <code>SET</code> clauses.</p>
<p>Example:</p>
<p class="notranslate">NAME = &#39;Test&#39;, VALUE = 2<br />(A, B) = (1, 2)<br />(A, B) = (1, 2), C = 3<br />(A, B) = (SELECT X, Y FROM OTHER T2 WHERE T1.ID = T2.ID)</p>

<h3 id="summand" class="notranslate" onclick="switchBnf(this)">Summand</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#factor">factor</a> [ { { + | - } <a href="grammar.html#factor">factor</a> } [...] ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#factor">factor</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#factor">factor</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#factor">factor</a> [ { { + | - } <a href="grammar.html#factor">factor</a> } [...] ]
</pre>
syntax-end -->
<p>A value or a numeric sum.</p><p>Please note the text concatenation operator is <code>||</code>.</p>
<p>Example:</p>
<p class="notranslate">ID + 20</p>

<h3 id="table_expression" class="notranslate" onclick="switchBnf(this)">Table Expression</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
{ [ <a href="grammar.html#name">schemaName</a>. ] <a href="grammar.html#name">tableName</a>
| ( <a href="grammar.html#query">query</a> )
| <a href="functions.html#unnest">unnest</a>
| <a href="functions.html#table">table</a>
| <a href="grammar.html#data_change_delta_table">dataChangeDeltaTable</a> }
[ [ AS ] <a href="grammar.html#alias">newTableAlias</a> [ ( <a href="grammar.html#name">columnName</a> [,...] ) ] ]
[ USE INDEX ([ <a href="grammar.html#name">indexName</a> [,...] ]) ]
[ { { LEFT | RIGHT } [ OUTER ] | [ INNER ] | CROSS | NATURAL }
JOIN <a href="grammar.html#table_expression">tableExpression</a> [ <a href="grammar.html#join_specification">joinSpecification</a> ] ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">schemaName</a> .</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">tableName</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#query">query</a> )</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="functions.html#unnest">unnest</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="functions.html#table">table</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#data_change_delta_table">dataChangeDeltaTable</a></code></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">AS</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#alias">newTableAlias</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">USE INDEX (</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">indexName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">LEFT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">RIGHT</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">OUTER</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">INNER</code></td><td class="le"></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">CROSS</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NATURAL</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">JOIN <a href="grammar.html#table_expression">tableExpression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#join_specification">joinSpecification</a></code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ [ <a href="grammar.html#name">schemaName</a>. ] <a href="grammar.html#name">tableName</a>
| ( <a href="grammar.html#query">query</a> )
| <a href="functions.html#unnest">unnest</a>
| <a href="functions.html#table">table</a>
| <a href="grammar.html#data_change_delta_table">dataChangeDeltaTable</a> }
[ [ AS ] <a href="grammar.html#alias">newTableAlias</a> [ ( <a href="grammar.html#name">columnName</a> [,...] ) ] ]
[ USE INDEX ([ <a href="grammar.html#name">indexName</a> [,...] ]) ]
[ { { LEFT | RIGHT } [ OUTER ] | [ INNER ] | CROSS | NATURAL }
JOIN <a href="grammar.html#table_expression">tableExpression</a> [ <a href="grammar.html#join_specification">joinSpecification</a> ] ]
</pre>
syntax-end -->
<p>Joins a table. The join specification is not supported for cross and natural joins. A natural join is an inner join, where the condition is automatically on the columns with the same name.</p>
<p>Example:</p>
<p class="notranslate">TEST1 AS T1 LEFT JOIN TEST2 AS T2 ON T1.ID = T2.PARENT_ID</p>

<h3 id="within_group_specification" class="notranslate" onclick="switchBnf(this)">Within group specification</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
WITHIN GROUP (ORDER BY {<a href="grammar.html#expression">expression</a> [ASC|DESC]} [,...])
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">WITHIN GROUP ( ORDER BY <a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">ASC</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DESC</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
WITHIN GROUP (ORDER BY {<a href="grammar.html#expression">expression</a> [ASC|DESC]} [,...])
</pre>
syntax-end -->
<p>Group specification for ordered set functions.</p>
<p>Example:</p>
<p class="notranslate">WITHIN GROUP (ORDER BY ID DESC)</p>

<h3 id="wildcard_expression" class="notranslate" onclick="switchBnf(this)">Wildcard expression</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
{* | <a href="grammar.html#alias">tableAlias</a>.*} [EXCEPT ([<a href="grammar.html#alias">tableAlias</a>.]<a href="grammar.html#name">columnName</a>, [,...])]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">*</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#alias">tableAlias</a> . *</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">EXCEPT (</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#alias">tableAlias</a> .</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">columnName</a> ,</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{* | <a href="grammar.html#alias">tableAlias</a>.*} [EXCEPT ([<a href="grammar.html#alias">tableAlias</a>.]<a href="grammar.html#name">columnName</a>, [,...])]
</pre>
syntax-end -->
<p>A wildcard expression in a <code>SELECT</code> statement. A wildcard expression represents all visible columns. Some columns can be excluded with optional <code>EXCEPT</code> clause.</p>
<p>Example:</p>
<p class="notranslate">*<br />* EXCEPT (DATA)</p>

<h3 id="window_name_or_specification" class="notranslate" onclick="switchBnf(this)">Window name or specification</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
<a href="grammar.html#name">windowName</a> | <a href="grammar.html#window_specification">windowSpecification</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#name">windowName</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#window_specification">windowSpecification</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#name">windowName</a> | <a href="grammar.html#window_specification">windowSpecification</a>
</pre>
syntax-end -->
<p>A window name or inline specification for a window function or aggregate.</p><p>Window functions in H2 may require a lot of memory for large queries.</p>
<p>Example:</p>
<p class="notranslate">W1<br />(ORDER BY ID)</p>

<h3 id="window_specification" class="notranslate" onclick="switchBnf(this)">Window specification</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
([<a href="grammar.html#name">existingWindowName</a>]
[PARTITION BY <a href="grammar.html#expression">expression</a> [,...]] [ORDER BY <a href="grammar.html#order">order</a> [,...]]
[<a href="grammar.html#window_frame">windowFrame</a>])
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">(</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#name">existingWindowName</a></code></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">PARTITION BY <a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ORDER BY <a href="grammar.html#order">order</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#window_frame">windowFrame</a></code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
([<a href="grammar.html#name">existingWindowName</a>]
[PARTITION BY <a href="grammar.html#expression">expression</a> [,...]] [ORDER BY <a href="grammar.html#order">order</a> [,...]]
[<a href="grammar.html#window_frame">windowFrame</a>])
</pre>
syntax-end -->
<p>A window specification for a window, window function or aggregate.</p><p>If name of an existing window is specified its clauses are used by default.</p><p>Optional window partition clause separates rows into independent partitions. Each partition is processed separately. If this clause is not present there is one implicit partition with all rows.</p><p>Optional window order clause specifies order of rows in the partition. If some rows have the same order position they are considered as a group of rows in optional window frame clause.</p><p>Optional window frame clause specifies which rows are processed by a window function, see its documentation for a more details.</p>
<p>Example:</p>
<p class="notranslate">()<br />(W1 ORDER BY ID)<br />(PARTITION BY CATEGORY)<br />(PARTITION BY CATEGORY ORDER BY NAME, ID)<br />(ORDER BY Y RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES)</p>

<h3 id="window_frame" class="notranslate" onclick="switchBnf(this)">Window frame</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ROWS|RANGE|GROUP
{<a href="grammar.html#window_frame_preceding">windowFramePreceding</a>|BETWEEN <a href="grammar.html#window_frame_bound">windowFrameBound</a> AND <a href="grammar.html#window_frame_bound">windowFrameBound</a>}
[EXCLUDE {CURRENT ROW|GROUP|TIES|NO OTHERS}]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">ROWS</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">RANGE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">GROUP</code></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#window_frame_preceding">windowFramePreceding</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">BETWEEN <a href="grammar.html#window_frame_bound">windowFrameBound</a> AND <a href="grammar.html#window_frame_bound">windowFrameBound</a></code></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">EXCLUDE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CURRENT ROW</code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">GROUP</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">TIES</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NO OTHERS</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ROWS|RANGE|GROUP
{<a href="grammar.html#window_frame_preceding">windowFramePreceding</a>|BETWEEN <a href="grammar.html#window_frame_bound">windowFrameBound</a> AND <a href="grammar.html#window_frame_bound">windowFrameBound</a>}
[EXCLUDE {CURRENT ROW|GROUP|TIES|NO OTHERS}]
</pre>
syntax-end -->
<p>A window frame clause. May be specified only for aggregates and <code>FIRST_VALUE</code>(), <code>LAST_VALUE</code>(), and <code>NTH_VALUE</code>() window functions.</p><p>If this clause is not specified for an aggregate or window function that supports this clause the default window frame depends on window order clause. If window order clause is also not specified the default window frame contains all the rows in the partition. If window order clause is specified the default window frame contains all preceding rows and all rows from the current group.</p><p>Window frame unit determines how rows or groups of rows are selected and counted. If <code>ROWS</code> is specified rows are not grouped in any way and relative numbers of rows are used in bounds. If <code>RANGE</code> is specified rows are grouped according window order clause, preceding and following values mean the difference between value in the current row and in the target rows, and <code>CURRENT ROW</code> in bound specification means current group of rows. If <code>GROUPS</code> is specified rows are grouped according window order clause, preceding and following values means relative number of groups of rows, and <code>CURRENT ROW</code> in bound specification means current group of rows.</p><p>If only window frame preceding clause is specified it is treated as <code>BETWEEN</code> windowFramePreceding <code>AND CURRENT ROW</code>.</p><p>Optional window frame exclusion clause specifies rows that should be excluded from the frame. <code>EXCLUDE CURRENT ROW</code> excludes only the current row regardless the window frame unit. <code>EXCLUDE GROUP</code> excludes the whole current group of rows, including the current row. <code>EXCLUDE TIES</code> excludes the current group of rows, but not the current row. <code>EXCLUDE NO OTHERS</code> is default and it does not exclude anything.</p>
<p>Example:</p>
<p class="notranslate">ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES</p>

<h3 id="window_frame_preceding" class="notranslate" onclick="switchBnf(this)">Window frame preceding</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
UNBOUNDED PRECEDING|<a href="grammar.html#value">value</a> PRECEDING|CURRENT ROW
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">UNBOUNDED PRECEDING</code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#value">value</a> PRECEDING</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CURRENT ROW</code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
UNBOUNDED PRECEDING|<a href="grammar.html#value">value</a> PRECEDING|CURRENT ROW
</pre>
syntax-end -->
<p>A window frame preceding clause. If value is specified it should not be negative.</p>
<p>Example:</p>
<p class="notranslate">UNBOUNDED PRECEDING<br />1 PRECEDING<br />CURRENT ROW</p>

<h3 id="window_frame_bound" class="notranslate" onclick="switchBnf(this)">Window frame bound</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
UNBOUNDED PRECEDING|<a href="grammar.html#value">value</a> PRECEDING|CURRENT ROW
|<a href="grammar.html#value">value</a> FOLLOWING|UNBOUNDED FOLLOWING
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">UNBOUNDED PRECEDING</code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#value">value</a> PRECEDING</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CURRENT ROW</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#value">value</a> FOLLOWING</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">UNBOUNDED FOLLOWING</code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
UNBOUNDED PRECEDING|<a href="grammar.html#value">value</a> PRECEDING|CURRENT ROW
|<a href="grammar.html#value">value</a> FOLLOWING|UNBOUNDED FOLLOWING
</pre>
syntax-end -->
<p>A window frame bound clause. If value is specified it should not be negative.</p>
<p>Example:</p>
<p class="notranslate">UNBOUNDED PRECEDING<br />UNBOUNDED FOLLOWING<br />1 FOLLOWING<br />CURRENT ROW</p>

<h3 id="term" class="notranslate" onclick="switchBnf(this)">Term</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
{ <a href="grammar.html#value">value</a>
| <a href="grammar.html#column">column</a>
| ?[ <a href="grammar.html#int">int</a> ]
| <a href="grammar.html#sequence_value_expression">sequenceValueExpression</a>
| function
| { - | + } <a href="grammar.html#term">term</a>
| ( <a href="grammar.html#expression">expression</a> )
| <a href="grammar.html#query">query</a>
| <a href="grammar.html#case">case</a>
| <a href="grammar.html#case_when">caseWhen</a>
| <a href="grammar.html#name">userDefinedFunctionName</a> }
[ <a href="grammar.html#time_zone">timeZone</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#value">value</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#column">column</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">?</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#int">int</a></code></td><td class="le"></td></tr></table></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#sequence_value_expression">sequenceValueExpression</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="functions.html">Function</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#term">term</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#expression">expression</a> )</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#query">query</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#case">case</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#case_when">caseWhen</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#name">userDefinedFunctionName</a></code></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#time_zone">timeZone</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ <a href="grammar.html#value">value</a>
| <a href="grammar.html#column">column</a>
| ?[ <a href="grammar.html#int">int</a> ]
| <a href="grammar.html#sequence_value_expression">sequenceValueExpression</a>
| function
| { - | + } <a href="grammar.html#term">term</a>
| ( <a href="grammar.html#expression">expression</a> )
| <a href="grammar.html#query">query</a>
| <a href="grammar.html#case">case</a>
| <a href="grammar.html#case_when">caseWhen</a>
| <a href="grammar.html#name">userDefinedFunctionName</a> }
[ <a href="grammar.html#time_zone">timeZone</a> ]
</pre>
syntax-end -->
<p>A value. Parameters can be indexed, for example <code>?1</code> meaning the first parameter.</p>
<p>Example:</p>
<p class="notranslate">&#39;Hello&#39;</p>

<h3 id="time_zone" class="notranslate" onclick="switchBnf(this)">Time zone</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
AT { TIME ZONE { <a href="grammar.html#interval_hour_to_minute">intervalHourToMinute</a> | <a href="grammar.html#interval_hour_to_second">intervalHourToSecond</a> | <a href="grammar.html#string">string</a> } | LOCAL }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">AT</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">TIME ZONE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#interval_hour_to_minute">intervalHourToMinute</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#interval_hour_to_second">intervalHourToSecond</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#string">string</a></code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">LOCAL</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
AT { TIME ZONE { <a href="grammar.html#interval_hour_to_minute">intervalHourToMinute</a> | <a href="grammar.html#interval_hour_to_second">intervalHourToSecond</a> | <a href="grammar.html#string">string</a> } | LOCAL }
</pre>
syntax-end -->
<p>A time zone. Converts the timestamp with or without time zone into timestamp with time zone at specified time zone. If a day-time interval is specified as a time zone, it may not have fractional seconds and must be between -18 to 18 hours inclusive.</p>
<p>Example:</p>
<p class="notranslate">AT LOCAL<br />AT TIME ZONE &#39;2&#39;<br />AT TIME ZONE &#39;-6:00&#39;<br />AT TIME ZONE INTERVAL &#39;10:00&#39; HOUR TO MINUTE<br />AT TIME ZONE INTERVAL &#39;10:00:00&#39; HOUR TO SECOND<br />AT TIME ZONE &#39;UTC&#39;<br />AT TIME ZONE &#39;Europe/London&#39;</p>

<h3 id="column" class="notranslate" onclick="switchBnf(this)">Column</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
[[<a href="grammar.html#name">schemaName</a>.]<a href="grammar.html#alias">tableAlias</a>.] { <a href="grammar.html#name">columnName</a> | _ROWID_ }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">schemaName</a> .</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#alias">tableAlias</a> .</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#name">columnName</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">_ROWID_</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[[<a href="grammar.html#name">schemaName</a>.]<a href="grammar.html#alias">tableAlias</a>.] { <a href="grammar.html#name">columnName</a> | _ROWID_ }
</pre>
syntax-end -->
<p>A column name with optional table alias and schema. _<code>ROWID_</code> can be used to access unique row identifier.</p>
<p>Example:</p>
<p class="notranslate">ID</p>

<!--[if lte IE 7]><script language="javascript">switchBnf(null);</script><![endif]-->

<!-- [close] { -->
</div></td></tr></table>
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="search.js"></script>
<script type="text/javascript">
function startTranslate() {
    document.getElementById('translate').style.display='';
    var script=document.createElement('script');
    script.setAttribute("type","text/javascript");
    script.setAttribute("src", "https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit");
    document.getElementsByTagName("head")[0].appendChild(script);
}
function googleTranslateElementInit() {
    new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>

<!-- } --><!-- analytics --></body></html>
